2年前写过一篇安装Docker的文档记录,当时安装有些麻烦,现在安装docker就非常容易了,而且安装完docker,自动也安装了docker compose,不用再去执行指令单独安装docker compose了,所以现在再记录一下,便于查看。
1、安装yum-utils包
yum install -y yum-utils
bash
[root@localhost ~]# yum install -y yum-utils
Loaded plugins: fastestmirror
Determining fastest mirrors
epel/x86_64/metalink | 6.8 kB 00:00:00
* base: mirrors.bfsu.edu.cn
* epel: mirror2.totbb.net
* extras: mirrors.cqu.edu.cn
* updates: mirrors.cqu.edu.cn
base | 3.6 kB 00:00:00
epel | 4.7 kB 00:00:00
extras | 2.9 kB 00:00:00
updates | 2.9 kB 00:00:00
(1/5): extras/7/x86_64/primary_db | 250 kB 00:00:00
(2/5): epel/x86_64/group_gz | 99 kB 00:00:01
(3/5): epel/x86_64/updateinfo | 1.0 MB 00:00:03
(4/5): updates/7/x86_64/primary_db | 22 MB 00:00:32
(5/5): epel/x86_64/primary_db | 7.0 MB 00:00:35
Resolving Dependencies
--> Running transaction check
---> Package yum-utils.noarch 0:1.1.31-54.el7_8 will be installed
--> Processing Dependency: python-kitchen for package: yum-utils-1.1.31-54.el7_8.noarch
--> Processing Dependency: libxml2-python for package: yum-utils-1.1.31-54.el7_8.noarch
--> Running transaction check
---> Package libxml2-python.x86_64 0:2.9.1-6.el7_9.6 will be installed
--> Processing Dependency: libxml2 = 2.9.1-6.el7_9.6 for package: libxml2-python-2.9.1-6.el7_9.6.x86_64
---> Package python-kitchen.noarch 0:1.1.1-5.el7 will be installed
--> Processing Dependency: python-chardet for package: python-kitchen-1.1.1-5.el7.noarch
--> Running transaction check
---> Package libxml2.x86_64 0:2.9.1-6.el7_2.3 will be updated
---> Package libxml2.x86_64 0:2.9.1-6.el7_9.6 will be an update
---> Package python-chardet.noarch 0:2.2.1-3.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
====================================================================================================
Package Arch Version Repository Size
====================================================================================================
Installing:
yum-utils noarch 1.1.31-54.el7_8 base 122 k
Installing for dependencies:
libxml2-python x86_64 2.9.1-6.el7_9.6 updates 247 k
python-chardet noarch 2.2.1-3.el7 base 227 k
python-kitchen noarch 1.1.1-5.el7 base 267 k
Updating for dependencies:
libxml2 x86_64 2.9.1-6.el7_9.6 updates 668 k
Transaction Summary
====================================================================================================
Install 1 Package (+3 Dependent packages)
Upgrade ( 1 Dependent package)
Total download size: 1.5 M
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
(1/5): yum-utils-1.1.31-54.el7_8.noarch.rpm | 122 kB 00:00:00
(2/5): python-chardet-2.2.1-3.el7.noarch.rpm | 227 kB 00:00:00
(3/5): libxml2-2.9.1-6.el7_9.6.x86_64.rpm | 668 kB 00:00:00
(4/5): libxml2-python-2.9.1-6.el7_9.6.x86_64.rpm | 247 kB 00:00:00
(5/5): python-kitchen-1.1.1-5.el7.noarch.rpm | 267 kB 00:00:00
----------------------------------------------------------------------------------------------------
Total 1.4 MB/s | 1.5 MB 00:00:01
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Updating : libxml2-2.9.1-6.el7_9.6.x86_64 1/6
Installing : libxml2-python-2.9.1-6.el7_9.6.x86_64 2/6
Installing : python-chardet-2.2.1-3.el7.noarch 3/6
Installing : python-kitchen-1.1.1-5.el7.noarch 4/6
Installing : yum-utils-1.1.31-54.el7_8.noarch 5/6
Cleanup : libxml2-2.9.1-6.el7_2.3.x86_64 6/6
Verifying : python-chardet-2.2.1-3.el7.noarch 1/6
Verifying : libxml2-2.9.1-6.el7_9.6.x86_64 2/6
Verifying : libxml2-python-2.9.1-6.el7_9.6.x86_64 3/6
Verifying : python-kitchen-1.1.1-5.el7.noarch 4/6
Verifying : yum-utils-1.1.31-54.el7_8.noarch 5/6
Verifying : libxml2-2.9.1-6.el7_2.3.x86_64 6/6
Installed:
yum-utils.noarch 0:1.1.31-54.el7_8
Dependency Installed:
libxml2-python.x86_64 0:2.9.1-6.el7_9.6 python-chardet.noarch 0:2.2.1-3.el7
python-kitchen.noarch 0:1.1.1-5.el7
Dependency Updated:
libxml2.x86_64 0:2.9.1-6.el7_9.6
Complete!
2、配置Docker存储库
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
bash
[root@localhost ~]# yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
Loaded plugins: fastestmirror
adding repo from: https://download.docker.com/linux/centos/docker-ce.repo
grabbing file https://download.docker.com/linux/centos/docker-ce.repo to /etc/yum.repos.d/docker-ce.repo
repo saved to /etc/yum.repos.d/docker-ce.repo
3、安装Docker Engine 与 Continerd
yum install docker-ce docker-ce-cli containerd.io
注:安装过程中会有 Is this ok [y/d/N] 的提示,输入y即可,或安装命令加-y,如下
yum install -y docker-ce docker-ce-cli containerd.io
bash
[root@localhost ~]# yum install docker-ce docker-ce-cli containerd.io
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.bfsu.edu.cn
* epel: mirror2.totbb.net
* extras: mirrors.cqu.edu.cn
* updates: mirrors.cqu.edu.cn
docker-ce-stable | 3.5 kB 00:00:00
(1/2): docker-ce-stable/7/x86_64/primary_db | 116 kB 00:00:00
(2/2): docker-ce-stable/7/x86_64/updateinfo | 55 B 00:00:02
Resolving Dependencies
--> Running transaction check
---> Package containerd.io.x86_64 0:1.6.22-3.1.el7 will be installed
--> Processing Dependency: container-selinux >= 2:2.74 for package: containerd.io-1.6.22-3.1.el7.x86_64
---> Package docker-ce.x86_64 3:24.0.5-1.el7 will be installed
--> Processing Dependency: docker-ce-rootless-extras for package: 3:docker-ce-24.0.5-1.el7.x86_64
--> Processing Dependency: libcgroup for package: 3:docker-ce-24.0.5-1.el7.x86_64
---> Package docker-ce-cli.x86_64 1:24.0.5-1.el7 will be installed
--> Processing Dependency: docker-buildx-plugin for package: 1:docker-ce-cli-24.0.5-1.el7.x86_64
--> Processing Dependency: docker-compose-plugin for package: 1:docker-ce-cli-24.0.5-1.el7.x86_64
--> Running transaction check
---> Package container-selinux.noarch 2:2.119.2-1.911c772.el7_8 will be installed
--> Processing Dependency: selinux-policy-targeted >= 3.13.1-216.el7 for package: 2:container-selinux-2.119.2-1.911c772.el7_8.noarch
--> Processing Dependency: selinux-policy-base >= 3.13.1-216.el7 for package: 2:container-selinux-2.119.2-1.911c772.el7_8.noarch
--> Processing Dependency: selinux-policy >= 3.13.1-216.el7 for package: 2:container-selinux-2.119.2-1.911c772.el7_8.noarch
--> Processing Dependency: policycoreutils-python for package: 2:container-selinux-2.119.2-1.911c772.el7_8.noarch
---> Package docker-buildx-plugin.x86_64 0:0.11.2-1.el7 will be installed
---> Package docker-ce-rootless-extras.x86_64 0:24.0.5-1.el7 will be installed
--> Processing Dependency: fuse-overlayfs >= 0.7 for package: docker-ce-rootless-extras-24.0.5-1.el7.x86_64
--> Processing Dependency: slirp4netns >= 0.4 for package: docker-ce-rootless-extras-24.0.5-1.el7.x86_64
---> Package docker-compose-plugin.x86_64 0:2.20.2-1.el7 will be installed
---> Package libcgroup.x86_64 0:0.41-21.el7 will be installed
--> Running transaction check
---> Package fuse-overlayfs.x86_64 0:0.7.2-6.el7_8 will be installed
--> Processing Dependency: libfuse3.so.3(FUSE_3.2)(64bit) for package: fuse-overlayfs-0.7.2-6.el7_8.x86_64
--> Processing Dependency: libfuse3.so.3(FUSE_3.0)(64bit) for package: fuse-overlayfs-0.7.2-6.el7_8.x86_64
--> Processing Dependency: libfuse3.so.3()(64bit) for package: fuse-overlayfs-0.7.2-6.el7_8.x86_64
---> Package policycoreutils-python.x86_64 0:2.5-34.el7 will be installed
--> Processing Dependency: policycoreutils = 2.5-34.el7 for package: policycoreutils-python-2.5-34.el7.x86_64
--> Processing Dependency: setools-libs >= 3.3.8-4 for package: policycoreutils-python-2.5-34.el7.x86_64
--> Processing Dependency: libsemanage-python >= 2.5-14 for package: policycoreutils-python-2.5-34.el7.x86_64
--> Processing Dependency: audit-libs-python >= 2.1.3-4 for package: policycoreutils-python-2.5-34.el7.x86_64
--> Processing Dependency: python-IPy for package: policycoreutils-python-2.5-34.el7.x86_64
--> Processing Dependency: libqpol.so.1(VERS_1.4)(64bit) for package: policycoreutils-python-2.5-34.el7.x86_64
--> Processing Dependency: libqpol.so.1(VERS_1.2)(64bit) for package: policycoreutils-python-2.5-34.el7.x86_64
--> Processing Dependency: libapol.so.4(VERS_4.0)(64bit) for package: policycoreutils-python-2.5-34.el7.x86_64
--> Processing Dependency: checkpolicy for package: policycoreutils-python-2.5-34.el7.x86_64
--> Processing Dependency: libqpol.so.1()(64bit) for package: policycoreutils-python-2.5-34.el7.x86_64
--> Processing Dependency: libapol.so.4()(64bit) for package: policycoreutils-python-2.5-34.el7.x86_64
---> Package selinux-policy.noarch 0:3.13.1-192.el7 will be updated
---> Package selinux-policy.noarch 0:3.13.1-268.el7_9.2 will be an update
--> Processing Dependency: libsemanage >= 2.5-13 for package: selinux-policy-3.13.1-268.el7_9.2.noarch
---> Package selinux-policy-targeted.noarch 0:3.13.1-192.el7 will be updated
---> Package selinux-policy-targeted.noarch 0:3.13.1-268.el7_9.2 will be an update
---> Package slirp4netns.x86_64 0:0.4.3-4.el7_8 will be installed
--> Running transaction check
---> Package audit-libs-python.x86_64 0:2.8.5-4.el7 will be installed
--> Processing Dependency: audit-libs(x86-64) = 2.8.5-4.el7 for package: audit-libs-python-2.8.5-4.el7.x86_64
---> Package checkpolicy.x86_64 0:2.5-8.el7 will be installed
---> Package fuse3-libs.x86_64 0:3.6.1-4.el7 will be installed
---> Package libsemanage.x86_64 0:2.5-11.el7 will be updated
---> Package libsemanage.x86_64 0:2.5-14.el7 will be an update
--> Processing Dependency: libsepol >= 2.5-10 for package: libsemanage-2.5-14.el7.x86_64
--> Processing Dependency: libselinux >= 2.5-14 for package: libsemanage-2.5-14.el7.x86_64
---> Package libsemanage-python.x86_64 0:2.5-14.el7 will be installed
---> Package policycoreutils.x86_64 0:2.5-22.el7 will be updated
---> Package policycoreutils.x86_64 0:2.5-34.el7 will be an update
--> Processing Dependency: libselinux-utils >= 2.5-14 for package: policycoreutils-2.5-34.el7.x86_64
---> Package python-IPy.noarch 0:0.75-6.el7 will be installed
---> Package setools-libs.x86_64 0:3.3.8-4.el7 will be installed
--> Running transaction check
---> Package audit-libs.x86_64 0:2.8.1-3.el7 will be updated
--> Processing Dependency: audit-libs(x86-64) = 2.8.1-3.el7 for package: audit-2.8.1-3.el7.x86_64
---> Package audit-libs.x86_64 0:2.8.5-4.el7 will be an update
---> Package libselinux.x86_64 0:2.5-12.el7 will be updated
--> Processing Dependency: libselinux(x86-64) = 2.5-12.el7 for package: libselinux-python-2.5-12.el7.x86_64
---> Package libselinux.x86_64 0:2.5-15.el7 will be an update
---> Package libselinux-utils.x86_64 0:2.5-12.el7 will be updated
---> Package libselinux-utils.x86_64 0:2.5-15.el7 will be an update
---> Package libsepol.x86_64 0:2.5-8.1.el7 will be updated
---> Package libsepol.x86_64 0:2.5-10.el7 will be an update
--> Running transaction check
---> Package audit.x86_64 0:2.8.1-3.el7 will be updated
---> Package audit.x86_64 0:2.8.5-4.el7 will be an update
---> Package libselinux-python.x86_64 0:2.5-12.el7 will be updated
---> Package libselinux-python.x86_64 0:2.5-15.el7 will be an update
--> Finished Dependency Resolution
Dependencies Resolved
====================================================================================================
Package Arch Version Repository Size
====================================================================================================
Installing:
containerd.io x86_64 1.6.22-3.1.el7 docker-ce-stable 34 M
docker-ce x86_64 3:24.0.5-1.el7 docker-ce-stable 24 M
docker-ce-cli x86_64 1:24.0.5-1.el7 docker-ce-stable 13 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
docker-buildx-plugin x86_64 0.11.2-1.el7 docker-ce-stable 13 M
docker-ce-rootless-extras x86_64 24.0.5-1.el7 docker-ce-stable 9.1 M
docker-compose-plugin x86_64 2.20.2-1.el7 docker-ce-stable 13 M
fuse-overlayfs x86_64 0.7.2-6.el7_8 extras 54 k
fuse3-libs x86_64 3.6.1-4.el7 extras 82 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
slirp4netns x86_64 0.4.3-4.el7_8 extras 81 k
Updating for dependencies:
audit x86_64 2.8.5-4.el7 base 256 k
audit-libs x86_64 2.8.5-4.el7 base 102 k
libselinux x86_64 2.5-15.el7 base 162 k
libselinux-python x86_64 2.5-15.el7 base 236 k
libselinux-utils x86_64 2.5-15.el7 base 151 k
libsemanage x86_64 2.5-14.el7 base 151 k
libsepol x86_64 2.5-10.el7 base 297 k
policycoreutils x86_64 2.5-34.el7 base 917 k
selinux-policy noarch 3.13.1-268.el7_9.2 updates 498 k
selinux-policy-targeted noarch 3.13.1-268.el7_9.2 updates 7.0 M
Transaction Summary
====================================================================================================
Install 3 Packages (+14 Dependent packages)
Upgrade ( 10 Dependent packages)
Total download size: 118 M
Is this ok [y/d/N]: y
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
(1/27): audit-libs-python-2.8.5-4.el7.x86_64.rpm | 76 kB 00:00:00
(2/27): container-selinux-2.119.2-1.911c772.el7_8.noarch.rpm | 40 kB 00:00:00
(3/27): audit-2.8.5-4.el7.x86_64.rpm | 256 kB 00:00:00
(4/27): checkpolicy-2.5-8.el7.x86_64.rpm | 295 kB 00:00:00
(5/27): audit-libs-2.8.5-4.el7.x86_64.rpm | 102 kB 00:00:00
warning: /var/cache/yum/x86_64/7/docker-ce-stable/packages/containerd.io-1.6.22-3.1.el7.x86_64.rpm: Header V4 RSA/SHA512 Signature, key ID 621e9f35: NOKEY
Public key for containerd.io-1.6.22-3.1.el7.x86_64.rpm is not installed
(6/27): containerd.io-1.6.22-3.1.el7.x86_64.rpm | 34 MB 00:00:47
(7/27): docker-buildx-plugin-0.11.2-1.el7.x86_64.rpm | 13 MB 00:01:12
(8/27): docker-ce-24.0.5-1.el7.x86_64.rpm | 24 MB 00:00:36
(9/27): docker-ce-rootless-extras-24.0.5-1.el7.x86_64.rpm | 9.1 MB 00:00:13
(10/27): fuse-overlayfs-0.7.2-6.el7_8.x86_64.rpm | 54 kB 00:00:00
(11/27): fuse3-libs-3.6.1-4.el7.x86_64.rpm | 82 kB 00:00:00
(12/27): libselinux-python-2.5-15.el7.x86_64.rpm | 236 kB 00:00:00
(13/27): libselinux-utils-2.5-15.el7.x86_64.rpm | 151 kB 00:00:00
(14/27): libsemanage-2.5-14.el7.x86_64.rpm | 151 kB 00:00:00
(15/27): libcgroup-0.41-21.el7.x86_64.rpm | 66 kB 00:00:00
(16/27): libsemanage-python-2.5-14.el7.x86_64.rpm | 113 kB 00:00:00
(17/27): policycoreutils-2.5-34.el7.x86_64.rpm | 917 kB 00:00:00
(18/27): policycoreutils-python-2.5-34.el7.x86_64.rpm | 457 kB 00:00:00
(19/27): python-IPy-0.75-6.el7.noarch.rpm | 32 kB 00:00:00
(20/27): libselinux-2.5-15.el7.x86_64.rpm | 162 kB 00:00:02
(21/27): libsepol-2.5-10.el7.x86_64.rpm | 297 kB 00:00:02
(22/27): setools-libs-3.3.8-4.el7.x86_64.rpm | 620 kB 00:00:05
(23/27): slirp4netns-0.4.3-4.el7_8.x86_64.rpm | 81 kB 00:00:02
(24/27): selinux-policy-3.13.1-268.el7_9.2.noarch.rpm | 498 kB 00:00:14
(25/27): docker-compose-plugin-2.20.2-1.el7.x86_64.rpm | 13 MB 00:00:28
(26/27): docker-ce-cli-24.0.5-1.el7.x86_64.rpm | 13 MB 00:00:54
(27/27): selinux-policy-targeted-3.13.1-268.el7_9.2.noarch.rpm | 7.0 MB 00:00:31
----------------------------------------------------------------------------------------------------
Total 920 kB/s | 118 MB 00:02:11
Retrieving key from https://download.docker.com/linux/centos/gpg
Importing GPG key 0x621E9F35:
Userid : "Docker Release (CE rpm) <docker@docker.com>"
Fingerprint: 060a 61c5 1b55 8a7f 742b 77aa c52f eb6b 621e 9f35
From : https://download.docker.com/linux/centos/gpg
Is this ok [y/N]: y
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Updating : libsepol-2.5-10.el7.x86_64 1/37
Updating : libselinux-2.5-15.el7.x86_64 2/37
Updating : audit-libs-2.8.5-4.el7.x86_64 3/37
Updating : libsemanage-2.5-14.el7.x86_64 4/37
Updating : libselinux-utils-2.5-15.el7.x86_64 5/37
Updating : policycoreutils-2.5-34.el7.x86_64 6/37
Updating : selinux-policy-3.13.1-268.el7_9.2.noarch 7/37
Installing : libcgroup-0.41-21.el7.x86_64 8/37
Updating : selinux-policy-targeted-3.13.1-268.el7_9.2.noarch 9/37
Installing : libsemanage-python-2.5-14.el7.x86_64 10/37
Installing : audit-libs-python-2.8.5-4.el7.x86_64 11/37
Updating : libselinux-python-2.5-15.el7.x86_64 12/37
Installing : setools-libs-3.3.8-4.el7.x86_64 13/37
Installing : docker-buildx-plugin-0.11.2-1.el7.x86_64 14/37
Installing : slirp4netns-0.4.3-4.el7_8.x86_64 15/37
Installing : fuse3-libs-3.6.1-4.el7.x86_64 16/37
Installing : fuse-overlayfs-0.7.2-6.el7_8.x86_64 17/37
Installing : python-IPy-0.75-6.el7.noarch 18/37
Installing : checkpolicy-2.5-8.el7.x86_64 19/37
Installing : policycoreutils-python-2.5-34.el7.x86_64 20/37
Installing : 2:container-selinux-2.119.2-1.911c772.el7_8.noarch 21/37
Installing : containerd.io-1.6.22-3.1.el7.x86_64 22/37
Installing : docker-compose-plugin-2.20.2-1.el7.x86_64 23/37
Installing : 1:docker-ce-cli-24.0.5-1.el7.x86_64 24/37
Installing : 3:docker-ce-24.0.5-1.el7.x86_64 25/37
Installing : docker-ce-rootless-extras-24.0.5-1.el7.x86_64 26/37
Updating : audit-2.8.5-4.el7.x86_64 27/37
Cleanup : selinux-policy-targeted-3.13.1-192.el7.noarch 28/37
Cleanup : selinux-policy-3.13.1-192.el7.noarch 29/37
Cleanup : policycoreutils-2.5-22.el7.x86_64 30/37
Cleanup : libsemanage-2.5-11.el7.x86_64 31/37
Cleanup : libselinux-utils-2.5-12.el7.x86_64 32/37
Cleanup : libselinux-python-2.5-12.el7.x86_64 33/37
Cleanup : libselinux-2.5-12.el7.x86_64 34/37
Cleanup : audit-2.8.1-3.el7.x86_64 35/37
Cleanup : audit-libs-2.8.1-3.el7.x86_64 36/37
Cleanup : libsepol-2.5-8.1.el7.x86_64 37/37
Verifying : fuse-overlayfs-0.7.2-6.el7_8.x86_64 1/37
Verifying : libselinux-2.5-15.el7.x86_64 2/37
Verifying : 2:container-selinux-2.119.2-1.911c772.el7_8.noarch 3/37
Verifying : docker-compose-plugin-2.20.2-1.el7.x86_64 4/37
Verifying : selinux-policy-targeted-3.13.1-268.el7_9.2.noarch 5/37
Verifying : docker-ce-rootless-extras-24.0.5-1.el7.x86_64 6/37
Verifying : audit-libs-2.8.5-4.el7.x86_64 7/37
Verifying : checkpolicy-2.5-8.el7.x86_64 8/37
Verifying : policycoreutils-2.5-34.el7.x86_64 9/37
Verifying : python-IPy-0.75-6.el7.noarch 10/37
Verifying : libselinux-utils-2.5-15.el7.x86_64 11/37
Verifying : policycoreutils-python-2.5-34.el7.x86_64 12/37
Verifying : fuse3-libs-3.6.1-4.el7.x86_64 13/37
Verifying : audit-2.8.5-4.el7.x86_64 14/37
Verifying : libsemanage-python-2.5-14.el7.x86_64 15/37
Verifying : libsemanage-2.5-14.el7.x86_64 16/37
Verifying : slirp4netns-0.4.3-4.el7_8.x86_64 17/37
Verifying : libsepol-2.5-10.el7.x86_64 18/37
Verifying : libselinux-python-2.5-15.el7.x86_64 19/37
Verifying : 1:docker-ce-cli-24.0.5-1.el7.x86_64 20/37
Verifying : selinux-policy-3.13.1-268.el7_9.2.noarch 21/37
Verifying : audit-libs-python-2.8.5-4.el7.x86_64 22/37
Verifying : docker-buildx-plugin-0.11.2-1.el7.x86_64 23/37
Verifying : setools-libs-3.3.8-4.el7.x86_64 24/37
Verifying : containerd.io-1.6.22-3.1.el7.x86_64 25/37
Verifying : 3:docker-ce-24.0.5-1.el7.x86_64 26/37
Verifying : libcgroup-0.41-21.el7.x86_64 27/37
Verifying : libsemanage-2.5-11.el7.x86_64 28/37
Verifying : libselinux-python-2.5-12.el7.x86_64 29/37
Verifying : audit-libs-2.8.1-3.el7.x86_64 30/37
Verifying : policycoreutils-2.5-22.el7.x86_64 31/37
Verifying : libsepol-2.5-8.1.el7.x86_64 32/37
Verifying : selinux-policy-3.13.1-192.el7.noarch 33/37
Verifying : selinux-policy-targeted-3.13.1-192.el7.noarch 34/37
Verifying : audit-2.8.1-3.el7.x86_64 35/37
Verifying : libselinux-2.5-12.el7.x86_64 36/37
Verifying : libselinux-utils-2.5-12.el7.x86_64 37/37
Installed:
containerd.io.x86_64 0:1.6.22-3.1.el7 docker-ce.x86_64 3:24.0.5-1.el7
docker-ce-cli.x86_64 1:24.0.5-1.el7
Dependency Installed:
audit-libs-python.x86_64 0:2.8.5-4.el7 checkpolicy.x86_64 0:2.5-8.el7
container-selinux.noarch 2:2.119.2-1.911c772.el7_8 docker-buildx-plugin.x86_64 0:0.11.2-1.el7
docker-ce-rootless-extras.x86_64 0:24.0.5-1.el7 docker-compose-plugin.x86_64 0:2.20.2-1.el7
fuse-overlayfs.x86_64 0:0.7.2-6.el7_8 fuse3-libs.x86_64 0:3.6.1-4.el7
libcgroup.x86_64 0:0.41-21.el7 libsemanage-python.x86_64 0:2.5-14.el7
policycoreutils-python.x86_64 0:2.5-34.el7 python-IPy.noarch 0:0.75-6.el7
setools-libs.x86_64 0:3.3.8-4.el7 slirp4netns.x86_64 0:0.4.3-4.el7_8
Dependency Updated:
audit.x86_64 0:2.8.5-4.el7 audit-libs.x86_64 0:2.8.5-4.el7
libselinux.x86_64 0:2.5-15.el7 libselinux-python.x86_64 0:2.5-15.el7
libselinux-utils.x86_64 0:2.5-15.el7 libsemanage.x86_64 0:2.5-14.el7
libsepol.x86_64 0:2.5-10.el7 policycoreutils.x86_64 0:2.5-34.el7
selinux-policy.noarch 0:3.13.1-268.el7_9.2 selinux-policy-targeted.noarch 0:3.13.1-268.el7_9.2
Complete!
4、检查是否安装成功 - 查看Docker版本
docker version
bash
[root@localhost ~]# docker version
Client: Docker Engine - Community
Version: 24.0.5
API version: 1.43
Go version: go1.20.6
Git commit: ced0996
Built: Fri Jul 21 20:39:02 2023
OS/Arch: linux/amd64
Context: default
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
查看Docker compose 版本
安装docker时,直接安装了docker compose.
docker compose version
bash
[root@localhost ~]# docker compose version
Docker Compose version v2.20.2
5、启动Docker
systemctl start docker
bash
[root@localhost ~]# systemctl start docker
[root@localhost ~]# docker images # 查看镜像
REPOSITORY TAG IMAGE ID CREATED SIZE
[root@localhost ~]# docker ps # 查看容器命令
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
6、设置开机启动
systemctl enable docker
bash
[root@localhost ~]# systemctl enable docker
Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service.