步骤

下载仓库

cd /etc/yum.repos.d/
wget http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

安装稳定版本

yum list docker-ce --showduplicates | sort -r
yum install docker-ce-18.09.9 docker-ce-cli-18.09.9 containerd.io -y

启动

systemctl start docker
systemctl status docker
docker info

相关冗余信息

[root@10-222-32-10 /etc/yum.repos.d]# yum list docker-ce --showduplicates | sort -r
Loading mirror speeds from cached hostfile
Loaded plugins: fastestmirror
docker-ce.x86_64            3:19.03.9-3.el7                     docker-ce-stable
docker-ce.x86_64            3:19.03.8-3.el7                     docker-ce-stable
docker-ce.x86_64            3:19.03.7-3.el7                     docker-ce-stable
docker-ce.x86_64            3:19.03.6-3.el7                     docker-ce-stable
docker-ce.x86_64            3:19.03.5-3.el7                     docker-ce-stable
docker-ce.x86_64            3:19.03.4-3.el7                     docker-ce-stable
docker-ce.x86_64            3:19.03.3-3.el7                     docker-ce-stable
docker-ce.x86_64            3:19.03.2-3.el7                     docker-ce-stable
docker-ce.x86_64            3:19.03.1-3.el7                     docker-ce-stable
docker-ce.x86_64            3:19.03.13-3.el7                    docker-ce-stable
docker-ce.x86_64            3:19.03.12-3.el7                    docker-ce-stable
docker-ce.x86_64            3:19.03.11-3.el7                    docker-ce-stable
docker-ce.x86_64            3:19.03.10-3.el7                    docker-ce-stable
docker-ce.x86_64            3:19.03.0-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            3:18.09.5-3.el7                     docker-ce-stable
docker-ce.x86_64            3:18.09.4-3.el7                     docker-ce-stable
docker-ce.x86_64            3:18.09.3-3.el7                     docker-ce-stable
docker-ce.x86_64            3:18.09.2-3.el7                     docker-ce-stable
docker-ce.x86_64            3:18.09.1-3.el7                     docker-ce-stable
docker-ce.x86_64            3:18.09.0-3.el7                     docker-ce-stable
docker-ce.x86_64            18.06.3.ce-3.el7                    docker-ce-stable
docker-ce.x86_64            18.06.2.ce-3.el7                    docker-ce-stable
docker-ce.x86_64            18.06.1.ce-3.el7                    docker-ce-stable
docker-ce.x86_64            18.06.0.ce-3.el7                    docker-ce-stable
docker-ce.x86_64            18.03.1.ce-1.el7.centos             docker-ce-stable
docker-ce.x86_64            18.03.0.ce-1.el7.centos             docker-ce-stable
docker-ce.x86_64            17.12.1.ce-1.el7.centos             docker-ce-stable
docker-ce.x86_64            17.12.0.ce-1.el7.centos             docker-ce-stable
docker-ce.x86_64            17.09.1.ce-1.el7.centos             docker-ce-stable
docker-ce.x86_64            17.09.0.ce-1.el7.centos             docker-ce-stable
docker-ce.x86_64            17.06.2.ce-1.el7.centos             docker-ce-stable
docker-ce.x86_64            17.06.1.ce-1.el7.centos             docker-ce-stable
docker-ce.x86_64            17.06.0.ce-1.el7.centos             docker-ce-stable
docker-ce.x86_64            17.03.3.ce-1.el7                    docker-ce-stable
docker-ce.x86_64            17.03.2.ce-1.el7.centos             docker-ce-stable
docker-ce.x86_64            17.03.1.ce-1.el7.centos             docker-ce-stable
docker-ce.x86_64            17.03.0.ce-1.el7.centos             docker-ce-stable



============================================================================================================================================================================================================
 Package                                               Arch                                  Version                                                  Repository                                       Size
============================================================================================================================================================================================================
Installing:
 containerd.io                                         x86_64                                1.3.7-3.1.el7                                            docker-ce-stable                                 29 M
 docker-ce                                             x86_64                                3:18.09.9-3.el7                                          docker-ce-stable                                 21 M
 docker-ce-cli                                         x86_64                                1:18.09.9-3.el7                                          docker-ce-stable                                 16 M
Installing for dependencies:
 audit-libs-python                                     x86_64                                2.8.5-4.el7                                              base                                             76 k
 checkpolicy                                           x86_64                                2.5-8.el7                                                base                                            295 k
 container-selinux                                     noarch                                2:2.119.2-1.911c772.el7_8                                extras                                           40 k
 libcgroup                                             x86_64                                0.41-21.el7                                              base                                             66 k
 libsemanage-python                                    x86_64                                2.5-14.el7                                               base                                            113 k
 policycoreutils-python                                x86_64                                2.5-34.el7                                               base                                            457 k
 python-IPy                                            noarch                                0.75-6.el7                                               base                                             32 k
 setools-libs                                          x86_64                                3.3.8-4.el7                                              base                                            620 k
============================================================================================================================================================================================================



[root@10-222-32-10 /etc/yum.repos.d]# systemctl status docker
● docker.service - Docker Application Container Engine
   Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
   Active: active (running) since Thu 2020-10-29 21:04:30 CST; 4s ago
     Docs: https://docs.docker.com
 Main PID: 3388 (dockerd)
    Tasks: 8
   Memory: 39.5M
   CGroup: /system.slice/docker.service
           └─3388 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock

Oct 29 21:04:30 10-222-32-10 dockerd[3388]: time="2020-10-29T21:04:30.288200182+08:00" level=info msg="pickfirstBalancer: HandleSubConnStateChange: 0xc00012ce10, CONNECTING" module=grpc
Oct 29 21:04:30 10-222-32-10 dockerd[3388]: time="2020-10-29T21:04:30.288257574+08:00" level=info msg="pickfirstBalancer: HandleSubConnStateChange: 0xc00012ce10, READY" module=grpc
Oct 29 21:04:30 10-222-32-10 dockerd[3388]: time="2020-10-29T21:04:30.310159088+08:00" level=info msg="Graph migration to content-addressability took 0.00 seconds"
Oct 29 21:04:30 10-222-32-10 dockerd[3388]: time="2020-10-29T21:04:30.310747349+08:00" level=info msg="Loading containers: start."
Oct 29 21:04:30 10-222-32-10 dockerd[3388]: time="2020-10-29T21:04:30.403581691+08:00" level=info msg="Default bridge (docker0) is assigned with an IP address 172.17.0.0/16. Daemon option ...d IP address"
Oct 29 21:04:30 10-222-32-10 dockerd[3388]: time="2020-10-29T21:04:30.433103208+08:00" level=info msg="Loading containers: done."
Oct 29 21:04:30 10-222-32-10 dockerd[3388]: time="2020-10-29T21:04:30.446735839+08:00" level=info msg="Docker daemon" commit=039a7df graphdriver(s)=overlay2 version=18.09.9
Oct 29 21:04:30 10-222-32-10 dockerd[3388]: time="2020-10-29T21:04:30.446793798+08:00" level=info msg="Daemon has completed initialization"
Oct 29 21:04:30 10-222-32-10 systemd[1]: Started Docker Application Container Engine.
Oct 29 21:04:30 10-222-32-10 dockerd[3388]: time="2020-10-29T21:04:30.464082388+08:00" level=info msg="API listen on /var/run/docker.sock"
Hint: Some lines were ellipsized, use -l to show in full.

本文地址:https://blog.csdn.net/xys2015/article/details/109370082