<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                ## CentOS 安裝 Docker CE >警告:切勿在沒有配置 Docker YUM 源的情況下直接使用 yum 命令安裝 Docker. ### 準備工作 #### 系統要求 Docker CE 支持 64 位版本 CentOS 7,并且要求內核版本不低于 3.10。 CentOS 7 滿足最低內核的要求,但由于內核版本比較低,部分功能(如 `overlay2` 存儲層驅動)無法使用,并且部分功能可能不太穩定。 #### 卸載舊版本 舊版本的 Docker 稱為 `docker` 或者 `docker-engine`,使用以下命令卸載舊版本: ```bash $ sudo yum remove docker \ docker-client \ docker-client-latest \ docker-common \ docker-latest \ docker-latest-logrotate \ docker-logrotate \ docker-selinux \ docker-engine-selinux \ docker-engine ``` ### 使用 yum 安裝 執行以下命令安裝依賴包: ```bash $ sudo yum install -y yum-utils \ device-mapper-persistent-data \ lvm2 ``` 鑒于國內網絡問題,強烈建議使用國內源,官方源請在注釋中查看。 執行下面的命令添加 `yum` 軟件源: ```bash $ sudo yum-config-manager \ --add-repo \ https://mirrors.ustc.edu.cn/docker-ce/linux/centos/docker-ce.repo # 官方源 # $ sudo yum-config-manager \ # --add-repo \ # https://download.docker.com/linux/centos/docker-ce.repo ``` 如果需要測試版本的 Docker CE 請使用以下命令: ```bash $ sudo yum-config-manager --enable docker-ce-test ``` 如果需要每日構建版本的 Docker CE 請使用以下命令: ```bash $ sudo yum-config-manager --enable docker-ce-nightly ``` #### 安裝 Docker CE 更新 `yum` 軟件源緩存,并安裝 `docker-ce`。 ```bash $ sudo yum makecache fast $ sudo yum install docker-ce ``` ### 使用腳本自動安裝 在測試或開發環境中 Docker 官方為了簡化安裝流程,提供了一套便捷的安裝腳本,CentOS 系統上可以使用這套腳本安裝: ```bash $ curl -fsSL get.docker.com -o get-docker.sh $ sudo sh get-docker.sh --mirror Aliyun ``` 執行這個命令后,腳本就會自動的將一切準備工作做好,并且把 Docker CE 的 Edge 版本安裝在系統中。 ### 啟動 Docker CE ```bash $ sudo systemctl enable docker $ sudo systemctl start docker ``` ### 建立 docker 用戶組 默認情況下,`docker` 命令會使用 [Unix socket](https://en.wikipedia.org/wiki/Unix_domain_socket) 與 Docker 引擎通訊。而只有 `root` 用戶和 `docker` 組的用戶才可以訪問 Docker 引擎的 Unix socket。出于安全考慮,一般 Linux 系統上不會直接使用 `root` 用戶。因此,更好地做法是將需要使用 `docker` 的用戶加入 `docker` 用戶組。 建立 `docker` 組: ```bash $ sudo groupadd docker ``` 將當前用戶加入 `docker` 組: ```bash $ sudo usermod -aG docker $USER ``` 退出當前終端并重新登錄,進行如下測試。 ### 測試 Docker 是否安裝正確 ```bash $ docker run hello-world Unable to find image 'hello-world:latest' locally latest: Pulling from library/hello-world ca4f61b1923c: Pull complete Digest: sha256:be0cd392e45be79ffeffa6b05338b98ebb16c87b255f48e297ec7f98e123905c Status: Downloaded newer image for hello-world:latest Hello from Docker! This message shows that your installation appears to be working correctly. To generate this message, Docker took the following steps: 1. The Docker client contacted the Docker daemon. 2. The Docker daemon pulled the "hello-world" image from the Docker Hub. (amd64) 3. The Docker daemon created a new container from that image which runs the executable that produces the output you are currently reading. 4. The Docker daemon streamed that output to the Docker client, which sent it to your terminal. To try something more ambitious, you can run an Ubuntu container with: $ docker run -it ubuntu bash Share images, automate workflows, and more with a free Docker ID: https://cloud.docker.com/ For more examples and ideas, visit: https://docs.docker.com/engine/userguide/ ``` 若能正常輸出以上信息,則說明安裝成功。 ### 鏡像加速 鑒于國內網絡問題,后續拉取 Docker 鏡像十分緩慢,強烈建議安裝 Docker 之后配置 [國內鏡像加速](mirror.md)。 ### 添加內核參數 默認配置下,如果在 CentOS 使用 Docker CE 看到下面的這些警告信息: ```bash WARNING: bridge-nf-call-iptables is disabled WARNING: bridge-nf-call-ip6tables is disabled ``` 請添加內核配置參數以啟用這些功能。 ```bash $ sudo tee -a /etc/sysctl.conf <<-EOF net.bridge.bridge-nf-call-ip6tables = 1 net.bridge.bridge-nf-call-iptables = 1 EOF ``` 然后重新加載 `sysctl.conf` 即可 ```bash $ sudo sysctl -p ``` ### 參考文檔 * [Docker 官方 CentOS 安裝文檔](https://docs.docker.com/engine/installation/linux/docker-ce/centos/)。
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看