查看yum源,发现并没有docker-ce仓库
[root@VM_32_167_centos ~]# ll /etc/yum.repos.d/
total 48
-rw-r--r-- 1 root root 614 Mar 22 11:04 CentOS-Base.repo
-rw-r--r-- 1 root root 1309 Nov 23 21:16 CentOS-CR.repo
-rw-r--r-- 1 root root 649 Nov 23 21:16 CentOS-Debuginfo.repo
-rw-r--r-- 1 root root 230 Mar 22 11:04 CentOS-Epel.repo
-rw-r--r-- 1 root root 314 Nov 23 21:16 CentOS-fasttrack.repo
-rw-r--r-- 1 root root 630 Nov 23 21:16 CentOS-Media.repo
-rw-r--r-- 1 root root 1331 Nov 23 21:16 CentOS-Sources.repo
-rw-r--r-- 1 root root 5701 Nov 23 21:16 CentOS-Vault.repo
这里推荐阿里的docker-ce仓库
[root@instance-j69t4n5q ~]# yum -y install yum-utils
Loaded plugins: langpacks, versionlock
Excluding 1 update due to versionlock (use "yum versionlock status" to show it)
Resolving Dependencies
--> Running transaction check
---> Package yum-utils.noarch 0:1.1.31-50.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
===================================================================================================================================================================================================================
Package Arch Version Repository Size ===================================================================================================================================================================================================================
Installing:
yum-utils noarch 1.1.31-50.el7 base 121 k
Transaction Summary
===================================================================================================================================================================================================================
Install 1 Package
Total download size: 121 k
Installed size: 337 k
Downloading packages:
yum-utils-1.1.31-50.el7.noarch.rpm 0% [ ] 0.0 B/s | 0 B --:--:-- ETA yum-utils-1.1.31-50.el7.noarch.rpm | 121 kB 00:00:01
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : yum-utils-1.1.31-50.el7.noarch 1/1
Verifying : yum-utils-1.1.31-50.el7.noarch 1/1
Installed:
yum-utils.noarch 0:1.1.31-50.el7
Complete!
[root@instance-j69t4n5q ~]# yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
Loaded plugins: langpacks, versionlock
adding repo from: https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
grabbing file https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo to /etc/yum.repos.d/docker-ce.repo
repo saved to /etc/yum.repos.d/docker-ce.repo
[root@instance-j69t4n5q ~]# yum list docker-ce --showduplicates|sort -r
Loaded plugins: langpacks, versionlock
Excluding 1 update due to versionlock (use "yum versionlock status" to show it)
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
Available Packages
[root@instance-j69t4n5q bin]# yum -y install docker-ce-18.06.3.ce
Loaded plugins: langpacks, versionlock
Excluding 1 update due to versionlock (use "yum versionlock status" to show it)
Resolving Dependencies
--> Running transaction check
---> Package docker-ce.x86_64 0:18.06.3.ce-3.el7 will be installed
--> Processing Dependency: libltdl.so.7()(64bit) for package: docker-ce-18.06.3.ce-3.el7.x86_64
--> Running transaction check
---> Package libtool-ltdl.x86_64 0:2.4.2-22.el7_3 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
===================================================================================================================================================================================================================
Package Arch Version Repository Size ===================================================================================================================================================================================================================
Installing:
docker-ce x86_64 18.06.3.ce-3.el7 docker-ce-stable 41 M Installing for dependencies:
libtool-ltdl x86_64 2.4.2-22.el7_3 base 49 k
Transaction Summary
===================================================================================================================================================================================================================
Install 1 Package (+1 Dependent package)
Total size: 41 M
Installed size: 168 M
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : libtool-ltdl-2.4.2-22.el7_3.x86_64 1/2
Installing : docker-ce-18.06.3.ce-3.el7.x86_64 2/2
Verifying : libtool-ltdl-2.4.2-22.el7_3.x86_64 1/2
Verifying : docker-ce-18.06.3.ce-3.el7.x86_64 2/2
Installed:
docker-ce.x86_64 0:18.06.3.ce-3.el7
Dependency Installed:
libtool-ltdl.x86_64 0:2.4.2-22.el7_3
Complete!
至此,docker已安装完成
[root@instance-j69t4n5q bin]# docker --version
Docker version 18.06.3-ce, build d7080c1