当前位置: 首页 > news >正文

Centos7 安装 Docker

2年前写过一篇安装Docker的文档记录,当时安装有些麻烦,现在安装docker就非常容易了,而且安装完docker,自动也安装了docker compose,不用再去执行指令单独安装docker compose了,所以现在再记录一下,便于查看。

1、安装yum-utils包

yum install -y yum-utils

[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 ResolutionDependencies 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 kpython-chardet            noarch            2.2.1-3.el7                   base               227 kpython-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 kTransaction 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 transactionUpdating   : 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

[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

[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 ResolutionDependencies Resolved====================================================================================================Package                       Arch       Version                        Repository            Size
====================================================================================================
Installing:containerd.io                 x86_64     1.6.22-3.1.el7                 docker-ce-stable      34 Mdocker-ce                     x86_64     3:24.0.5-1.el7                 docker-ce-stable      24 Mdocker-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 kcheckpolicy                   x86_64     2.5-8.el7                      base                 295 kcontainer-selinux             noarch     2:2.119.2-1.911c772.el7_8      extras                40 kdocker-buildx-plugin          x86_64     0.11.2-1.el7                   docker-ce-stable      13 Mdocker-ce-rootless-extras     x86_64     24.0.5-1.el7                   docker-ce-stable     9.1 Mdocker-compose-plugin         x86_64     2.20.2-1.el7                   docker-ce-stable      13 Mfuse-overlayfs                x86_64     0.7.2-6.el7_8                  extras                54 kfuse3-libs                    x86_64     3.6.1-4.el7                    extras                82 klibcgroup                     x86_64     0.41-21.el7                    base                  66 klibsemanage-python            x86_64     2.5-14.el7                     base                 113 kpolicycoreutils-python        x86_64     2.5-34.el7                     base                 457 kpython-IPy                    noarch     0.75-6.el7                     base                  32 ksetools-libs                  x86_64     3.3.8-4.el7                    base                 620 kslirp4netns                   x86_64     0.4.3-4.el7_8                  extras                81 k
Updating for dependencies:audit                         x86_64     2.8.5-4.el7                    base                 256 kaudit-libs                    x86_64     2.8.5-4.el7                    base                 102 klibselinux                    x86_64     2.5-15.el7                     base                 162 klibselinux-python             x86_64     2.5-15.el7                     base                 236 klibselinux-utils              x86_64     2.5-15.el7                     base                 151 klibsemanage                   x86_64     2.5-14.el7                     base                 151 klibsepol                      x86_64     2.5-10.el7                     base                 297 kpolicycoreutils               x86_64     2.5-34.el7                     base                 917 kselinux-policy                noarch     3.13.1-268.el7_9.2             updates              498 kselinux-policy-targeted       noarch     3.13.1-268.el7_9.2             updates              7.0 MTransaction 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 9f35From       : https://download.docker.com/linux/centos/gpg
Is this ok [y/N]: y
Running transaction check
Running transaction test
Transaction test succeeded
Running transactionUpdating   : 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

[root@localhost ~]# docker version
Client: Docker Engine - CommunityVersion:           24.0.5API version:       1.43Go version:        go1.20.6Git commit:        ced0996Built:             Fri Jul 21 20:39:02 2023OS/Arch:           linux/amd64Context:           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

[root@localhost ~]# docker compose version
Docker Compose version v2.20.2

 5、启动Docker

systemctl start docker

[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

[root@localhost ~]# systemctl enable docker
Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service.

相关文章:

Centos7 安装 Docker

2年前写过一篇安装Docker的文档记录&#xff0c;当时安装有些麻烦&#xff0c;现在安装docker就非常容易了&#xff0c;而且安装完docker&#xff0c;自动也安装了docker compose&#xff0c;不用再去执行指令单独安装docker compose了&#xff0c;所以现在再记录一下&#xff…...

Java虚拟机内部组成

1、栈区 public class Math {public int compute(){//一个方法对应一块栈帧内存区域int a l;int b 2;int c (a b)*10;return c; } public static void main(String[] args){Math math new, Math() ;math.compute() ;System.out.println("test");}} 栈是先进后出…...

python遍历文件夹下的所有子文件夹,并将指定的文件复制到指定目录

python遍历文件夹下的所有子文件夹&#xff0c;并将指定的文件复制到指定目录 需求复制单个文件夹遍历所有子文件夹中的文件&#xff0c;并复制代码封装 需求 在1文件夹中有1&#xff0c;2两个文件夹 将这两个文件夹中的文件复制到 after_copy中 复制单个文件夹 # coding: ut…...

[golang 流媒体在线直播系统] 1.直播的简单介绍以及借助腾讯云直播实现在线直播

一.直播的简单介绍 1.介绍 直播,应该不陌生,有电视直播、网络主播、游戏直播、体育直播、在线教育直播等等,那么要实现在线直播的话就 必须要有 “ 流媒体在线直播服务器 ”. “流媒体在线直播服务器 ”不仅可以 实现游戏、赛事、电商、媒体、教育等行业的直播, 还可以实现 …...

C# 中操作集合的方法

Add&#xff1a;向集合中添加元素。 List<int> numbers new List<int>(){ 1, 2, 3 }; numbers.Add(4); // numbers 现在为 { 1, 2, 3, 4 }Remove&#xff1a;从集合中移除指定的元素。 List<int> numbers new List<int>(){ 1, 2, 3, 4 }; numbers.Re…...

pytorch学习(8)——现有网络模型的使用以及修改

1 vgg16模型 1.1 vgg16模型的下载 采用torchvision中的vgg16模型&#xff0c;能够实现1000个类型的图像分类&#xff0c;VGG模型在AlexNet的基础上使用3*3小卷积核&#xff0c;增加网络深度&#xff0c;具有很好的泛化能力。 首先下载vgg16模型&#xff0c;python代码如下&…...

get和post请求的区别

GET和POST是HTTP请求的两种方法,其区别如下 ① GET请求表示从指定的服务器中获取数据(请求数据),比如查询用户信息;POST请求表示将数据提交到指定的服务器进行处理(发送数据), ② GET请求是一个幂等的请求,一般用于对服务器资源不会产生影响的场景,比如说请求一个网友的…...

extern “C”关键字的作用

目录 概述C和C在函数调用和变量命名等方面的差异示例总结 概述 extern "C"是用于在C中声明使用C语言编写的函数和变量的关键字。C和C在函数调用和变量命名等方面存在一些差异&#xff0c;为了在C代码中正确地使用C语言的函数和变量&#xff0c;需要使用extern "…...

使用ffmpeg截取视频片段

本文将介绍2中使用ffmpeg截取视频的方法 指定截取视频的 开始时间 和 结束时间&#xff0c;进行视频截取指定截取视频的 开始时间 和 截取的秒数&#xff0c;进行视频截取 两种截取方式的命令行如下 截取某一时间段视频 优先使用 ffmpeg -i ./input.mp4 -c:v libx264 -crf…...

Python教程(11)——Python中的字典dict的用法介绍

dict的用法介绍 创建字典访问字典修改字典删除字典字典的相关函数 列表虽然好&#xff0c;但是如果需要快速的数据查找&#xff0c;就必须进行需要遍历&#xff0c;也就是最坏情况需要遍历完一遍才能找到需要的那个数据&#xff0c;时间复杂度是O(n)&#xff0c;显然这个速度是…...

三道dfs题

一&#xff1a;1114. 棋盘问题 - AcWing题库 分别枚举行和列&#xff0c;能填的地方就填&#xff0c;dfs就行 #include <iostream> using namespace std;const int N 10; char g[N][N]; int n, k; int res; bool st[N];void dfs(int u, int cnt) // u枚举行 {if(cnt …...

Seaborn数据可视化(四)

目录 1.绘制箱线图 2.绘制小提琴图 3.绘制多面板图 4.绘制等高线图 5.绘制热力图 1.绘制箱线图 import seaborn as sns import matplotlib.pyplot as plt # 加载示例数据&#xff08;例如&#xff0c;使用seaborn自带的数据集&#xff09; tips sns.load_dataset("t…...

kubernetes deploy standalone mysql demo

kubernetes 集群内部署 单节点 mysql ansible all -m shell -a "mkdir -p /mnt/mysql/data"cat mysql-pv-pvc.yaml apiVersion: v1 kind: PersistentVolume metadata:name: mysql-pv-volumelabels:type: local spec:storageClassName: manualcapacity:storage: 5Gi…...

【Map】Map集合有序与无序测试案例:HashMap,TreeMap,LinkedHashMap(121)

简单介绍常用的三种Map&#xff1a;不足之处&#xff0c;欢迎指正&#xff01; HashMap&#xff1a;put数据是无序的&#xff1b; TreeMap&#xff1a;key值按一定的顺序排序&#xff1b;数字做key&#xff0c;put数据是有序&#xff0c;非数字字符串做key&#xff0c;put数据…...

TiDB Serverless Branching:通过数据库分支简化应用开发流程

2023 年 7 月 10 日&#xff0c;TiDB Serverless 正式商用。这是一个完全托管的数据库服务平台&#xff08;DBaaS&#xff09;&#xff0c;提供灵活的集群配置和基于用量的付费模式。紧随其后&#xff0c;TiDB Serverless Branching 的测试版也发布了。 TiDB Serverless Branc…...

运用亚马逊云科技Amazon Kendra,快速部署企业智能搜索应用

亚马逊云科技Amazon Kendra是一项由机器学习&#xff08;ML&#xff09;提供支持的企业搜索服务。Kendra内置数据源连接器&#xff0c;支持快速访问Amazon S3、AmazonRDS、AmazonFSX以及其他外部数据源&#xff0c;帮助用户自动提取文档并建立索引。Kendra支持超过30多种多国语…...

C# 使用 OleDbConnection 连接读取Excel的方法

Connection类有四种:SqlConnection&#xff0c;OleDbConnection&#xff0c;OdbcConnection和OracleConnection。 &#xff08;1&#xff09;Sqlconnetcion类的对象连接是SQL Server数据库&#xff1b; &#xff08;2&#xff09;OracleConnection类的对象连接Oracle数据库&…...

【LeetCode-中等题】98. 验证二叉搜索树

文章目录 题目方法一&#xff1a;BFS 层序遍历方法二&#xff1a; 递归方法三&#xff1a; 中序遍历&#xff08;栈&#xff09;方法四&#xff1a; 中序遍历&#xff08;递归&#xff09; 题目 思路就是首先得知道什么是二叉搜索树 左孩子在&#xff08;父节点的最小值&#x…...

Leetcode-每日一题【剑指 Offer 37. 序列化二叉树】

题目 请实现两个函数&#xff0c;分别用来序列化和反序列化二叉树。 你需要设计一个算法来实现二叉树的序列化与反序列化。这里不限定你的序列 / 反序列化算法执行逻辑&#xff0c;你只需要保证一个二叉树可以被序列化为一个字符串并且将这个字符串反序列化为原始的树结构。 …...

删除无点击数据offer数据分析使用

梳理思路&#xff1a; 1、 获取 7month 和 8month fullreport 报表中 所有offer&#xff1b;输出结果&#xff1a;offerid&#xff0c; totalClickCount&#xff1b; 2、 分析数据7month totalClickCount0 and 8month totalClickCount0 的offer去除&#xff1b; result.…...

【Apollo学习笔记】——规划模块TASK之SPEED_BOUNDS_PRIORI_DECIDER

文章目录 前言SPEED_BOUNDS_PRIORI_DECIDER功能简介SPEED_BOUNDS_PRIORI_DECIDER相关配置SPEED_BOUNDS_PRIORI_DECIDER流程将障碍物映射到ST图中ComputeSTBoundary(PathDecision* path_decision)ComputeSTBoundary(Obstacle* obstacle)GetOverlapBoundaryPointsComputeSTBounda…...

物理机ping不通windows server 2012

刚才尝试各种方法&#xff0c;在物理机上就是ping不能wmware中的windows server 2012 . 折腾了几个小时&#xff0c;原来是icmp 被windows server 2012 禁用了 现在使用使用以下协议就能启用Icmp协议。 netsh firewall set icmpsetting 8然后&#xff0c;就能正常ping 通虚…...

誉天HCIE-Datacom丨为什么选择誉天数通HCIE课程学习

大家好&#xff0c;我是誉天HCIE-Datacom的一名学员&#xff0c;在2022年觉得自己技术水平不够&#xff0c;想要提升自己&#xff0c;经朋友介绍在誉天报的名。 听朋友说誉天的阮Sir的课讲的非常好&#xff0c;我在B站上看了几节阮老师的课确实比之前在听得其他机构的课程讲的要…...

Python文本终端GUI框架详解

今天笔者带大家&#xff0c;梳理几个常见的基于文本终端的 UI 框架&#xff0c;一睹为快&#xff01; Curses 首先出场的是 Curses。 Curses 是一个能提供基于文本终端窗口功能的动态库&#xff0c;它可以: 使用整个屏幕 创建和管理一个窗口 使用 8 种不同的彩色 为程序提供…...

01_lwip_raw_udp_test

1.打开UDP的调试功能 &#xff08;1&#xff09;设置宏定义 &#xff08;2&#xff09;打开UDP的调试功能 &#xff08;3&#xff09;修改内容&#xff0c;串口助手打印的日志信息自动换行 2.电脑端连接 UDP发送一帧数据 3.电路板上发送一帧数据...

学习ts(十一)本地存储与发布订阅模式

localStorage实现过期时间 目录 准备 安装 npm i rollup typescript rollup-plugin-typescript2// tsconfig.json"module": "ESNext","moduleResolution": "node", "strict": false, // rollup.config.js import …...

MySQL对NULL值处理

在使用数据库时&#xff0c;有时需要表示未知值&#xff0c;这时可以使用NULL值表示。引入NULL值后&#xff0c;会对原有的使用产生影响&#xff0c;这里记录下常见的场景&#xff0c;以做记录。 NULL含义 在MySQL中&#xff0c;NULL值表示一个未知值&#xff0c;表示不可知、…...

Vector 动态数组(迭代器)

C数据结构与算法 目录 本文前驱课程 1 C自学精简教程 目录(必读) 2 Vector<T> 动态数组&#xff08;模板语法&#xff09; 本文目标 1 熟悉迭代器设计模式&#xff1b; 2 实现数组的迭代器&#xff1b; 3 基于迭代器的容器遍历&#xff1b; 迭代器语法介绍 对迭…...

多组背包恰好装满方案数

链接&#xff1a;登录—专业IT笔试面试备考平台_牛客网 来源&#xff1a;牛客网 现在有一个大小n*1的收纳盒&#xff0c;我们手里有无数个大小为1*1和2*1的小方块&#xff0c;我们需要用这些方块填满收纳盒&#xff0c;请问我们有多少种不同的方法填满这个收纳盒 分析&…...

Oracle查询语句中做日期加减运算

在Oracle中&#xff0c;可以使用日期函数来实现日期的加减。 若想在日期上加上一定的天数&#xff0c;可以使用"INTERVAL"关键字。例如&#xff0c;如果要将一个日期加上3天&#xff0c;可以使用以下代码&#xff1a; SELECT SYSDATE INTERVAL 3 DAY FROM DUAL; …...