The steps for installing centos7 docker are described in detail
- 2020-06-01 11:26:27
- OfStack
docker centos7 installation
Installation guide address https: 1. The website / / docs docker. com/engine/installation/linux/centos /
2. View the kernel version
[root@localhost ~]# uname -r
3.10.0-327.el7.x86_64
[root@localhost ~]#
3. Add the yum source
$ sudo tee /etc/yum.repos.d/docker.repo <<-'EOF'
[dockerrepo]
name=Docker Repository
baseurl=https://yum.dockerproject.org/repo/main/centos/7/
enabled=1
gpgcheck=1
gpgkey=https://yum.dockerproject.org/gpg
EOF
4. Install docker - engine
yum install docker-engine
The output example is as follows:
Working on dependencies
--> Checking transaction
---> The software package docker-engine.x86_64.0.1.12.5-1.el7.centos Will be The installation
--> Working on dependencies docker-engine-selinux >= 1.12.5-1.el7.centos , it is packaged docker-engine-1.12.5-1.el7.centos.x86_64 Need to be
--> Working on dependencies libcgroup , it is packaged docker-engine-1.12.5-1.el7.centos.x86_64 Need to be
--> Working on dependencies libseccomp.so.2()(64bit) , it is packaged docker-engine-1.12.5-1.el7.centos.x86_64 Need to be
--> Working on dependencies libltdl.so.7()(64bit) , it is packaged docker-engine-1.12.5-1.el7.centos.x86_64 Need to be
--> Checking transaction
---> The software package docker-engine-selinux.noarch.0.1.12.5-1.el7.centos Will be The installation
--> Working on dependencies policycoreutils-python , it is packaged docker-engine-selinux-1.12.5-1.el7.centos.noarch Need to be
---> The software package libcgroup.x86_64.0.0.41-11.el7 Will be The installation
---> The software package libseccomp.x86_64.0.2.3.1-2.el7 Will be The installation
---> The software package libtool-ltdl.x86_64.0.2.4.2-21.el7_2 Will be The installation
--> Checking transaction
---> The software package policycoreutils-python.x86_64.0.2.5-9.el7 Will be The installation
--> Working on dependencies policycoreutils = 2.5-9.el7 , it is packaged policycoreutils-python-2.5-9.el7.x86_64 Need to be
--> Working on dependencies setools-libs >= 3.3.8-1 , it is packaged policycoreutils-python-2.5-9.el7.x86_64 Need to be
--> Working on dependencies libsemanage-python >= 2.5-4 , it is packaged policycoreutils-python-2.5-9.el7.x86_64 Need to be
--> Working on dependencies audit-libs-python >= 2.1.3-4 , it is packaged policycoreutils-python-2.5-9.el7.x86_64 Need to be
--> Working on dependencies python-IPy , it is packaged policycoreutils-python-2.5-9.el7.x86_64 Need to be
--> Working on dependencies libsepol.so.1(LIBSEPOL_1.0)(64bit) , it is packaged policycoreutils-python-2.5-9.el7.x86_64 Need to be
--> Working on dependencies libqpol.so.1(VERS_1.4)(64bit) , it is packaged policycoreutils-python-2.5-9.el7.x86_64 Need to be
--> Working on dependencies libqpol.so.1(VERS_1.2)(64bit) , it is packaged policycoreutils-python-2.5-9.el7.x86_64 Need to be
--> Working on dependencies libapol.so.4(VERS_4.0)(64bit) , it is packaged policycoreutils-python-2.5-9.el7.x86_64 Need to be
--> Working on dependencies checkpolicy , it is packaged policycoreutils-python-2.5-9.el7.x86_64 Need to be
--> Working on dependencies libqpol.so.1()(64bit) , it is packaged policycoreutils-python-2.5-9.el7.x86_64 Need to be
--> Working on dependencies libapol.so.4()(64bit) , it is packaged policycoreutils-python-2.5-9.el7.x86_64 Need to be
--> Checking transaction
---> The software package audit-libs-python.x86_64.0.2.6.5-3.el7 Will be The installation
--> Working on dependencies audit-libs(x86-64) = 2.6.5-3.el7 , it is packaged audit-libs-python-2.6.5-3.el7.x86_64 Need to be
---> The software package checkpolicy.x86_64.0.2.5-4.el7 Will be The installation
---> The software package libsemanage-python.x86_64.0.2.5-4.el7 Will be The installation
--> Working on dependencies libsemanage = 2.5-4.el7 , it is packaged libsemanage-python-2.5-4.el7.x86_64 Need to be
--> Working on dependencies libsemanage.so.1(LIBSEMANAGE_1.1)(64bit) , it is packaged libsemanage-python-2.5-4.el7.x86_64 Need to be
---> The software package libsepol.x86_64.0.2.1.9-3.el7 Will be upgrade
---> The software package libsepol.x86_64.0.2.5-6.el7 Will be update
---> The software package policycoreutils.x86_64.0.2.2.5-20.el7 Will be upgrade
---> The software package policycoreutils.x86_64.0.2.5-9.el7 Will be update
--> Working on dependencies libselinux-utils >= 2.5-6 , it is packaged policycoreutils-2.5-9.el7.x86_64 Need to be
---> The software package python-IPy.noarch.0.0.75-6.el7 Will be The installation
---> The software package setools-libs.x86_64.0.3.3.8-1.1.el7 Will be The installation
--> Working on dependencies libselinux >= 2.5-0 , it is packaged setools-libs-3.3.8-1.1.el7.x86_64 Need to be
--> Checking transaction
---> The software package audit-libs.x86_64.0.2.4.1-5.el7 Will be upgrade
--> Working on dependencies audit-libs = 2.4.1-5.el7 , it is packaged audit-2.4.1-5.el7.x86_64 Need to be
---> The software package audit-libs.x86_64.0.2.6.5-3.el7 Will be update
---> The software package libselinux.x86_64.0.2.2.2-6.el7 Will be upgrade
--> Working on dependencies libselinux = 2.2.2-6.el7 , it is packaged libselinux-python-2.2.2-6.el7.x86_64 Need to be
---> The software package libselinux.x86_64.0.2.5-6.el7 Will be update
---> The software package libselinux-utils.x86_64.0.2.2.2-6.el7 Will be upgrade
---> The software package libselinux-utils.x86_64.0.2.5-6.el7 Will be update
---> The software package libsemanage.x86_64.0.2.1.10-18.el7 Will be upgrade
---> The software package libsemanage.x86_64.0.2.5-4.el7 Will be update
--> Checking transaction
---> The software package audit.x86_64.0.2.4.1-5.el7 Will be upgrade
---> The software package audit.x86_64.0.2.6.5-3.el7 Will be update
---> The software package libselinux-python.x86_64.0.2.2.2-6.el7 Will be upgrade
---> The software package libselinux-python.x86_64.0.2.5-6.el7 Will be update
--> To deal with libselinux-2.5-6.el7.x86_64 with systemd < 219-20 The conflict of
--> New information is being used to re-resolve dependencies
--> Checking transaction
---> The software package systemd.x86_64.0.219-19.el7 Will be upgrade
--> Working on dependencies systemd = 219-19.el7 , it is packaged systemd-sysv-219-19.el7.x86_64 Need to be
---> The software package systemd.x86_64.0.219-30.el7_3.6 Will be update
--> Working on dependencies systemd-libs = 219-30.el7_3.6 , it is packaged systemd-219-30.el7_3.6.x86_64 Need to be
--> Checking transaction
---> The software package systemd-libs.x86_64.0.219-19.el7 Will be upgrade
--> Working on dependencies systemd-libs = 219-19.el7 , it is packaged libgudev1-219-19.el7.x86_64 Need to be
---> The software package systemd-libs.x86_64.0.219-30.el7_3.6 Will be update
---> The software package systemd-sysv.x86_64.0.219-19.el7 Will be upgrade
---> The software package systemd-sysv.x86_64.0.219-30.el7_3.6 Will be update
--> Checking transaction
---> The software package libgudev1.x86_64.0.219-19.el7 Will be upgrade
---> The software package libgudev1.x86_64.0.219-30.el7_3.6 Will be update
--> To deal with libsemanage-2.5-4.el7.x86_64 with selinux-policy-base < 3.13.1-66 The conflict of
--> New information is being used to re-resolve dependencies
--> Checking transaction
---> The software package selinux-policy-targeted.noarch.0.3.13.1-60.el7 Will be upgrade
---> The software package selinux-policy-targeted.noarch.0.3.13.1-102.el7_3.7 Will be update
--> Working on dependencies selinux-policy = 3.13.1-102.el7_3.7 , it is packaged selinux-policy-targeted-3.13.1-102.el7_3.7.noarch Need to be
--> Working on dependencies selinux-policy = 3.13.1-102.el7_3.7 , it is packaged selinux-policy-targeted-3.13.1-102.el7_3.7.noarch Need to be
--> Checking transaction
---> The software package selinux-policy.noarch.0.3.13.1-60.el7 Will be upgrade
---> The software package selinux-policy.noarch.0.3.13.1-102.el7_3.7 Will be update
--> Resolve dependencies complete
Dependency resolution
===========================================================================================================================================================================
Package architecture version The source The size of the
===========================================================================================================================================================================
You are setting up :
docker-engine x86_64 1.12.5-1.el7.centos dockerrepo 19 M
Being updated :
selinux-policy-targeted noarch 3.13.1-102.el7_3.7 updates 6.4 M
systemd x86_64 219-30.el7_3.6 updates 5.2 M
Install for dependencies :
audit-libs-python x86_64 2.6.5-3.el7 base 70 k
checkpolicy x86_64 2.5-4.el7 base 290 k
docker-engine-selinux noarch 1.12.5-1.el7.centos dockerrepo 28 k
libcgroup x86_64 0.41-11.el7 base 65 k
libseccomp x86_64 2.3.1-2.el7 base 56 k
libsemanage-python x86_64 2.5-4.el7 base 103 k
libtool-ltdl x86_64 2.4.2-21.el7_2 base 49 k
policycoreutils-python x86_64 2.5-9.el7 updates 444 k
python-IPy noarch 0.75-6.el7 base 32 k
setools-libs x86_64 3.3.8-1.1.el7 base 612 k
Update for dependencies :
audit x86_64 2.6.5-3.el7 base 233 k
audit-libs x86_64 2.6.5-3.el7 base 85 k
libgudev1 x86_64 219-30.el7_3.6 updates 76 k
libselinux x86_64 2.5-6.el7 base 161 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-4.el7 base 144 k
libsepol x86_64 2.5-6.el7 base 288 k
policycoreutils x86_64 2.5-9.el7 updates 841 k
selinux-policy noarch 3.13.1-102.el7_3.7 updates 412 k
systemd-libs x86_64 219-30.el7_3.6 updates 368 k
systemd-sysv x86_64 219-30.el7_3.6 updates 63 k
The transaction summary
===========================================================================================================================================================================
The installation 1 The software package (+10 Dependent package )
upgrade 2 The software package (+12 Dependent package )
Total downloads: 35 M
Is this ok [y/d/N]:
The installation is completed as follows:
Has been installed :
docker-engine.x86_64 0:1.12.5-1.el7.centos
Installed as a dependency :
audit-libs-python.x86_64 0:2.6.5-3.el7 checkpolicy.x86_64 0:2.5-4.el7 docker-engine-selinux.noarch 0:1.12.5-1.el7.centos
libcgroup.x86_64 0:0.41-11.el7 libseccomp.x86_64 0:2.3.1-2.el7 libsemanage-python.x86_64 0:2.5-4.el7
libtool-ltdl.x86_64 0:2.4.2-21.el7_2 policycoreutils-python.x86_64 0:2.5-9.el7 python-IPy.noarch 0:0.75-6.el7
setools-libs.x86_64 0:3.3.8-1.1.el7
Updated completely :
selinux-policy-targeted.noarch 0:3.13.1-102.el7_3.7 systemd.x86_64 0:219-30.el7_3.6
Upgraded as a dependency :
audit.x86_64 0:2.6.5-3.el7 audit-libs.x86_64 0:2.6.5-3.el7 libgudev1.x86_64 0:219-30.el7_3.6 libselinux.x86_64 0:2.5-6.el7
libselinux-python.x86_64 0:2.5-6.el7 libselinux-utils.x86_64 0:2.5-6.el7 libsemanage.x86_64 0:2.5-4.el7 libsepol.x86_64 0:2.5-6.el7
policycoreutils.x86_64 0:2.5-9.el7 selinux-policy.noarch 0:3.13.1-102.el7_3.7 systemd-libs.x86_64 0:219-30.el7_3.6 systemd-sysv.x86_64 0:219-30.el7_3.6
Finished!
5. Start docker
systemctl start docker.service
6. Verify that docker is enabled
[root@localhost ~]# docker info
Containers: 0
Running: 0
Paused: 0
Stopped: 0
Images: 0
Server Version: 1.12.5
Storage Driver: devicemapper
Pool Name: docker-253:0-67405897-pool
Pool Blocksize: 65.54 kB
Base Device Size: 10.74 GB
Backing Filesystem: xfs
Data file: /dev/loop0
Metadata file: /dev/loop1
Data Space Used: 11.8 MB
Data Space Total: 107.4 GB
Data Space Available: 49.78 GB
Metadata Space Used: 581.6 kB
Metadata Space Total: 2.147 GB
Metadata Space Available: 2.147 GB
Thin Pool Minimum Free Space: 10.74 GB
Udev Sync Supported: true
Deferred Removal Enabled: false
Deferred Deletion Enabled: false
Deferred Deleted Device Count: 0
Data loop file: /var/lib/docker/devicemapper/devicemapper/data
WARNING: Usage of loopback devices is strongly discouraged for production use. Use `--storage-opt dm.thinpooldev` to specify a custom block storage device.
Metadata loop file: /var/lib/docker/devicemapper/devicemapper/metadata
Library Version: 1.02.107-RHEL7 (2015-10-14)
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: null host bridge overlay
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Security Options: seccomp
Kernel Version: 3.10.0-327.el7.x86_64
Operating System: CentOS Linux 7 (Core)
OSType: linux
Architecture: x86_64
CPUs: 1
Total Memory: 2.21 GiB
Name: localhost.localdomain
ID: 2JLT:WFL6:MRZY:UIHV:KACM:4AB7:3RQT:LEWL:CI4L:UVAP:CHKN:5CHX
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
WARNING: bridge-nf-call-iptables is disabled
WARNING: bridge-nf-call-ip6tables is disabled
Insecure Registries:
127.0.0.0/8
Thank you for reading, I hope to help you, thank you for your support of this site!