<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>

                要安裝 Docker CE(社區)版本,推薦使用 CentOS 7,使用`overlay2`存儲驅動程序。 ### ## 卸載舊版本 ### 舊版本的 Docker 叫`docker`或者`docker-engine`,現在的版本被稱為`docker-ce`,如果之前安裝過,則先卸載掉之前的版本: ### ``` $ sudo yum remove docker \ docker-client \ docker-client-latest \ docker-common \ docker-latest \ docker-latest-logrotate \ docker-logrotate \ docker-engine ``` ### ## 安裝 Docker-CE ### 要安裝 Docker 有多種方法,大多數用戶會設置 Docker 的存儲倉庫來進行安裝,這種方式可以簡化我們的安裝和升級,當然也推薦使用這種方式。 ### 但是如果你的服務器無法訪問互聯網則可以使用手動下載 RPM 安裝包進行安裝,如果你要使用這種方式安裝,可以在頁面[https://download.docker.com/linux/centos/7/x86\_64/stable/Packages/](https://download.docker.com/linux/centos/7/x86_64/stable/Packages/)下載自己想要安裝的`.rpm`文件然后直接安裝即可。 ### 我們這里通過在線方式進行安裝,首先安裝倉庫,先安裝一些依賴包,其中`yum-utils`提供了`yum-config-manager`的一些實用的功能: ### ``` $ sudo yum install -y yum-utils ``` ### 然后用下面的命令添加`stable`版本的 docker 倉庫: ### ``` $ sudo yum-config-manager \ --add-repo \ https://download.docker.com/linux/centos/docker-ce.repo ``` ### 添加完成后就可以安裝了,如果要安裝最新版本,直接執行下面的命令即可: ### ``` $ yum install docker-ce docker-ce-cli containerd.io ``` ### 如果要安裝指定的版本,可以通過如下命令來獲取可安裝的版本: ### ``` $ yum list docker-ce --showduplicates | sort -r * updates: mirrors.tuna.tsinghua.edu.cn Loading mirror speeds from cached hostfile Loaded plugins: fastestmirror, langpacks * extras: mirrors.huaweicloud.com docker-ce.x86_64 3:19.03.4-3.el7 docker-ce-stable ...... docker-ce.x86_64 3:18.09.9-3.el7 docker-ce-stable docker-ce.x86_64 3:18.09.8-3.el7 docker-ce-stable docker-ce.x86_64 3:18.09.7-3.el7 docker-ce-stable docker-ce.x86_64 3:18.09.6-3.el7 docker-ce-stable ...... docker-ce.x86_64 18.06.0.ce-3.el7 docker-ce-stable ``` ### 該軟件包名稱是軟件包名稱(docker-ce)加上版本字符串(第二列),從第一個冒號(:)開始,直至第一個連字符,并用連字符(-)分隔 )。 比如這里我們來安裝 docker-ce-18.09.9 版本: ### ``` $ sudo yum install docker-ce-18.09.9 docker-ce-cli-18.09.9 containerd.io -y ``` ### 安裝完成,但是還沒有啟動,由于我這里的磁盤空間不大,所以需要更改下 Docker 的根目錄,將默認的`/var/lib/docker`更改為`/data/docker`目錄,添加如下配置文件: ### ``` $ mkdir -p /etc/docker $ vi /etc/docker/daemon.json { "registry-mirrors" : [ "https://ot2k4d59.mirror.aliyuncs.com/" ], "graph": "/data/docker" } ``` ### > 鏡像加速器 > 使用加速器可以提升獲取 Docker 官方鏡像的速度,建議注冊阿里云帳號,使用阿里云提供的鏡像加速服務,地址:https://cr.console.aliyun.com/cn-beijing/instances/mirrors。 ### 然后執行下面的命令啟動 docker: ### ``` # 設置為開機啟動 $ systemctl enable docker $ systemctl daemon-reload # 啟動 docker $ systemctl start docker ``` ### 啟動成功后,可以通過如下命令查看 Docker 相關信息: ### ``` $ docker info docker info Containers: 0 Running: 0 Paused: 0 Stopped: 0 Images: 0 Server Version: 18.09.9 Storage Driver: overlay2 Backing Filesystem: extfs Supports d_type: true Native Overlay Diff: false Logging Driver: json-file Cgroup Driver: cgroupfs Plugins: Volume: local Network: bridge host macvlan null overlay Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog Swarm: inactive Runtimes: runc Default Runtime: runc Init Binary: docker-init containerd version: b34a5c8af56e510852c35414db4c1f4fa6172339 runc version: 3e425f80a8c931f88e6d94a8c831b9d5aa481657 init version: fec3683 Security Options: seccomp Profile: default Kernel Version: 3.10.0-327.el7.x86_64 Operating System: CentOS Linux 7 (Core) OSType: linux Architecture: x86_64 CPUs: 4 Total Memory: 7.64GiB Name: pnhmltdr ID: VIBG:JCTE:KBVO:ETXD:OZH4:SXCH:MA7Y:YFFB:KQEX:OLAM:I25P:F2TM Docker Root Dir: /data/docker Debug Mode (client): false Debug Mode (server): false Registry: https://index.docker.io/v1/ Labels: Experimental: false Insecure Registries: 127.0.0.0/8 Registry Mirrors: https://ot2k4d59.mirror.aliyuncs.com/ Live Restore Enabled: false Product License: Community Engine ``` ### 可以看到安裝的版本是 18.09.9,默認的存儲驅動程序是`overlay2`,而且`Root Dir`也已經是我們更改后的目錄了。 ### ## 測試 ### Docker 啟動成功后,我們可以使用下面的命令來運行一個測試容器: ### ``` $ docker run hello-world Unable to find image 'hello-world:latest' locally latest: Pulling from library/hello-world 1b930d010525: Pull complete Digest: sha256:c3b4ada4687bbaa170745b3e4dd8ac3f194ca95b2d0518b417fb47e5879d9b5f 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://hub.docker.com/ For more examples and ideas, visit: https://docs.docker.com/get-started/ ``` ### 看到如上的一些信息打印出來證明我們的 Docker 就已經安裝成功了。
                  <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>

                              哎呀哎呀视频在线观看