CentOS平台下的Docker安装与启动
1、参考
https://www.docker.com/docker-windows
https://blog.csdn.net/chengyuqiang/article/details/78886986
1、安装docker
(1)搜索docker
[root@node3 ~]# yum search docker
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
========================================================================== N/S matched: docker ===========================================================================
cockpit-docker.x86_64 : Cockpit user interface for Docker containers
docker-client.x86_64 : Client side files for Docker
docker-client-latest.x86_64 : Client side files for Docker
docker-common.x86_64 : Common files for docker and docker-latest
docker-distribution.x86_64 : Docker toolset to pack, ship, store, and deliver content
docker-latest-logrotate.x86_64 : cron job to run logrotate on Docker containers
docker-latest-v1.10-migrator.x86_64 : Calculates SHA256 checksums for docker layer content
docker-logrotate.x86_64 : cron job to run logrotate on Docker containers
docker-lvm-plugin.x86_64 : Docker volume driver for lvm volumes
docker-python.x86_64 : An API client for docker written in Python
docker-registry.noarch : Registry server for Docker
docker-registry.x86_64 : Registry server for Docker
docker-v1.10-migrator.x86_64 : Calculates SHA256 checksums for docker layer content
python-docker-py.noarch : An API client for docker written in Python
python-docker-pycreds.noarch : Python bindings for the docker credentials store API
docker.x86_64 : Automates deployment of containerized applications
docker-devel.x86_64 : A golang registry for global request variables (source libraries)
docker-forward-journald.x86_64 : Forward stdin to journald
docker-latest.x86_64 : Automates deployment of containerized applications
docker-novolume-plugin.x86_64 : Block container starts with local volumes defined
docker-unit-test.x86_64 : Automates deployment of containerized applications - for running unit tests
oci-systemd-hook.x86_64 : OCI systemd hook for docker
oci-umount.x86_64 : OCI umount hook for docker
skopeo.x86_64 : Inspect Docker images and repositories on registries
Name and summary matches only, use "search all" for everything.
(2)安装docker
[root@node3 ~]# yum install -y docker
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
Resolving Dependencies
--> Running transaction check
---> Package docker.x86_64 2:1.12.6-32.git88a4867.el7.centos will be installed
--> Processing Dependency: docker-common = 2:1.12.6-32.git88a4867.el7.centos for package: 2:docker-1.12.6-32.git88a4867.el7.centos.x86_64
....
....
---> Package systemd-libs.x86_64 0:219-30.el7_3.9 will be an update
---> Package systemd-python.x86_64 0:219-19.el7 will be updated
---> Package systemd-python.x86_64 0:219-30.el7_3.9 will be an update
---> Package systemd-sysv.x86_64 0:219-19.el7 will be updated
---> Package systemd-sysv.x86_64 0:219-30.el7_3.9 will be an update
--> Running transaction check
---> Package libgudev1.x86_64 0:219-19.el7 will be updated
---> Package libgudev1.x86_64 0:219-30.el7_3.9 will be an update
--> Finished Dependency Resolution
Dependencies Resolved
==========================================================================================================================================================================
Package Arch Version Repository Size
==========================================================================================================================================================================
Installing:
docker x86_64 2:1.12.6-32.git88a4867.el7.centos extras 14 M
Updating:
selinux-policy-targeted noarch 3.13.1-102.el7_3.16 updates 6.4 M
systemd x86_64 219-30.el7_3.9 updates 5.2 M
Installing for dependencies:
container-selinux noarch 2:2.19-2.1.el7 extras 28 k
docker-client x86_64 2:1.12.6-32.git88a4867.el7.centos extras 3.2 M
docker-common x86_64 2:1.12.6-32.git88a4867.el7.centos extras 77 k
oci-register-machine x86_64 1:0-3.11.gitdd0daef.el7 extras 1.0 M
oci-systemd-hook x86_64 1:0.1.7-4.gite533efa.el7 extras 30 k
skopeo-containers x86_64 1:0.1.20-2.el7 extras 7.8 k
Updating for dependencies:
libgudev1 x86_64 219-30.el7_3.9 updates 77 k
libselinux x86_64 2.5-6.el7 base 161 k
libselinux-devel x86_64 2.5-6.el7 base 186 k
libselinux-python x86_64 2.5-6.el7 base 234 k
libselinux-utils x86_64 2.5-6.el7 base 151 k
libsemanage x86_64 2.5-5.1.el7_3 updates 144 k
libsemanage-python x86_64 2.5-5.1.el7_3 updates 104 k
libsepol x86_64 2.5-6.el7 base 288 k
libsepol-devel x86_64 2.5-6.el7 base 74 k
policycoreutils x86_64 2.5-11.el7_3 updates 841 k
policycoreutils-python x86_64 2.5-11.el7_3 updates 445 k
selinux-policy noarch 3.13.1-102.el7_3.16 updates 414 k
setools-libs x86_64 3.3.8-1.1.el7 base 612 k
systemd-libs x86_64 219-30.el7_3.9 updates 369 k
systemd-python x86_64 219-30.el7_3.9 updates 110 k
systemd-sysv x86_64 219-30.el7_3.9 updates 64 k
Transaction Summary
==========================================================================================================================================================================
Install 1 Package (+ 6 Dependent packages)
Upgrade 2 Packages (+16 Dependent packages)
Total size: 34 M
Total download size: 33 M
Downloading packages:
Delta RPMs reduced 7.0 M of updates to 3.9 M (43% saved)
(1/18): policycoreutils-python-2.2.5-20.el7_2.5-11.el7_3.x86_64.drpm | 259 kB 00:00:00
(2/18): policycoreutils-2.2.5-20.el7_2.5-11.el7_3.x86_64.drpm | 433 kB 00:00:00
(3/18): systemd-libs-219-19.el7_219-30.el7_3.9.x86_64.drpm | 170 kB 00:00:00
(4/18): systemd-python-219-19.el7_219-30.el7_3.9.x86_64.drpm | 80 kB 00:00:00
(5/18): container-selinux-2.19-2.1.el7.noarch.rpm | 28 kB 00:00:00
(6/