可使用以下命令,安装 Docker :
yum -y install docker
[root@localhost pluginconf.d]#yum -y install docker
base | 3.6 kB 00:00
extras | 3.4 kB 00:00
updates | 3.4 kB 00:00
Resolving Dependencies
--> Running transaction check
---> Package docker.x86_64 2:1.12.6-71.git3e8e77d.el7.centos.1 will be installed
--> Processing Dependency: docker-common = 2:1.12.6-71.git3e8e77d.el7.centos.1 for package: 2:docker-1.12.6-71.git3e8e77d.el7.centos.1.x86_64
--> Processing Dependency: docker-client = 2:1.12.6-71.git3e8e77d.el7.centos.1 for package: 2:docker-1.12.6-71.git3e8e77d.el7.centos.1.x86_64
--> Running transaction check
---> Package docker-client.x86_64 2:1.12.6-71.git3e8e77d.el7.centos.1 will be installed
---> Package docker-common.x86_64 2:1.12.6-71.git3e8e77d.el7.centos.1 will be installed
--> Processing Dependency: skopeo-containers >= 0.1.24-3 for package: 2:docker-common-1.12.6-71.git3e8e77d.el7.centos.1.x86_64
--> Processing Dependency: oci-umount >= 2:2.0.0-1 for package: 2:docker-common-1.12.6-71.git3e8e77d.el7.centos.1.x86_64
--> Processing Dependency: oci-systemd-hook >= 1:0.1.4-9 for package: 2:docker-common-1.12.6-71.git3e8e77d.el7.centos.1.x86_64
--> Processing Dependency: oci-register-machine >= 1:0-3.14 for package: 2:docker-common-1.12.6-71.git3e8e77d.el7.centos.1.x86_64
--> Processing Dependency: container-storage-setup >= 0.7.0-1 for package: 2:docker-common-1.12.6-71.git3e8e77d.el7.centos.1.x86_64
--> Processing Dependency: container-selinux >= 2:2.21-2 for package: 2:docker-common-1.12.6-71.git3e8e77d.el7.centos.1.x86_64
--> Running transaction check
---> Package container-selinux.noarch 2:2.36-1.gitff95335.el7 will be installed
---> Package container-storage-setup.noarch 0:0.8.0-3.git1d27ecf.el7 will be installed
---> Package oci-register-machine.x86_64 1:0-3.14.gitcd1e331.el7 will be installed
---> Package oci-systemd-hook.x86_64 1:0.1.14-2.git9b1e622.el7 will be installed
---> Package oci-umount.x86_64 2:2.3.1-2.gitbf16163.el7 will be installed
---> Package skopeo-containers.x86_64 1:0.1.26-2.dev.git2e8377a.el7.centos will be installed
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================
Package Arch Version Repository
Size
================================================================================
Installing:
docker x86_64 2:1.12.6-71.git3e8e77d.el7.centos.1 extras 15 M
Installing for dependencies:
container-selinux noarch 2:2.36-1.gitff95335.el7 extras 31 k
container-storage-setup
noarch 0.8.0-3.git1d27ecf.el7 extras 33 k
docker-client x86_64 2:1.12.6-71.git3e8e77d.el7.centos.1 extras 3.4 M
docker-common x86_64 2:1.12.6-71.git3e8e77d.el7.centos.1 extras 83 k
oci-register-machine x86_64 1:0-3.14.gitcd1e331.el7 extras 1.1 M
oci-systemd-hook x86_64 1:0.1.14-2.git9b1e622.el7 extras 32 k
oci-umount x86_64 2:2.3.1-2.gitbf16163.el7 extras 30 k
skopeo-containers x86_64 1:0.1.26-2.dev.git2e8377a.el7.centos extras 12 k
Transaction Summary
================================================================================
Install 1 Package (+8 Dependent packages)
Total download size: 19 M
Installed size: 66 M
Downloading packages:
(1/9): container-storage-setup-0.8.0-3.git1d27ecf.el7.noar | 33 kB 00:00
(2/9): container-selinux-2.36-1.gitff95335.el7.noarch.rpm | 31 kB 00:00
(3/9): docker-common-1.12.6-71.git3e8e77d.el7.centos.1.x86 | 83 kB 00:00
(4/9): oci-systemd-hook-0.1.14-2.git9b1e622.el7.x86_64.rpm | 32 kB 00:00
(5/9): oci-umount-2.3.1-2.gitbf16163.el7.x86_64.rpm | 30 kB 00:00
(6/9): skopeo-containers-0.1.26-2.dev.git2e8377a.el7.cento | 12 kB 00:00
(7/9): oci-register-machine-0-3.14.gitcd1e331.el7.x86_64.r | 1.1 MB 00:00
(8/9): docker-client-1.12.6-71.git3e8e77d.el7.centos.1.x86 | 3.4 MB 00:03
(9/9): docker-1.12.6-71.git3e8e77d.el7.centos.1.x86_64.rpm | 15 MB 02:32
--------------------------------------------------------------------------------
Total 130 kB/s | 19 MB 02:32
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : 1:oci-systemd-hook-0.1.14-2.git9b1e622.el7.x86_64 1/9
Installing : container-storage-setup-0.8.0-3.git1d27ecf.el7.noarch 2/9
Installing : 1:oci-register-machine-0-3.14.gitcd1e331.el7.x86_64 3/9
Installing : 2:container-selinux-2.36-1.gitff95335.el7.noarch 4/9
Installing : 2:oci-umount-2.3.1-2.gitbf16163.el7.x86_64 5/9
Installing : 1:skopeo-containers-0.1.26-2.dev.git2e8377a.el7.centos.x86 6/9
Installing : 2:docker-common-1.12.6-71.git3e8e77d.el7.centos.1.x86_64 7/9
Installing : 2:docker-client-1.12.6-71.git3e8e77d.el7.centos.1.x86_64 8/9
Installing : 2:docker-1.12.6-71.git3e8e77d.el7.centos.1.x86_64 9/9
Verifying : 2:docker-client-1.12.6-71.git3e8e77d.el7.centos.1.x86_64 1/9
Verifying : 1:skopeo-containers-0.1.26-2.dev.git2e8377a.el7.centos.x86 2/9
Verifying : 2:oci-umount-2.3.1-2.gitbf16163.el7.x86_64 3/9
Verifying : 2:container-selinux-2.36-1.gitff95335.el7.noarch 4/9
Verifying : 1:oci-register-machine-0-3.14.gitcd1e331.el7.x86_64 5/9
Verifying : container-storage-setup-0.8.0-3.git1d27ecf.el7.noarch 6/9
Verifying : 2:docker-common-1.12.6-71.git3e8e77d.el7.centos.1.x86_64 7/9
Verifying : 2:docker-1.12.6-71.git3e8e77d.el7.centos.1.x86_64 8/9
Verifying : 1:oci-systemd-hook-0.1.14-2.git9b1e622.el7.x86_64 9/9
Installed:
docker.x86_64 2:1.12.6-71.git3e8e77d.el7.centos.1
Dependency Installed:
container-selinux.noarch 2:2.36-1.gitff95335.el7
container-storage-setup.noarch 0:0.8.0-3.git1d27ecf.el7
docker-client.x86_64 2:1.12.6-71.git3e8e77d.el7.centos.1
docker-common.x86_64 2:1.12.6-71.git3e8e77d.el7.centos.1
oci-register-machine.x86_64 1:0-3.14.gitcd1e331.el7
oci-systemd-hook.x86_64 1:0.1.14-2.git9b1e622.el7
oci-umount.x86_64 2:2.3.1-2.gitbf16163.el7
skopeo-containers.x86_64 1:0.1.26-2.dev.git2e8377a.el7.centos
Complete!
可使用以下命令,查看 Docker 是否安装成功:
docker version
[root@localhost pluginconf.d]# docker version
Client:
Version: 1.12.6
API version: 1.24
Package version: docker-1.12.6-71.git3e8e77d.el7.centos.1.x86_64
Go version: go1.8.3
Git commit: 3e8e77d/1.12.6
Built: Tue Jan 30 09:17:00 2018
OS/Arch: linux/amd64
Cannot connect to the Docker daemon. Is the docker daemon running on this host?
若输出了 Docker 的版本号,则说明安装成功,我们下面就可以开始使用 Docker 了。
可通过以下命令启动 Docker 服务:
[root@localhost pluginconf.d]# service docker start
Redirecting to /bin/systemctl start docker.service
[root@localhost pluginconf.d]#