当前位置: 首页 > 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.…...

基于距离变化能量开销动态调整的WSN低功耗拓扑控制开销算法matlab仿真

目录 1.程序功能描述 2.测试软件版本以及运行结果展示 3.核心程序 4.算法仿真参数 5.算法理论概述 6.参考文献 7.完整程序 1.程序功能描述 通过动态调整节点通信的能量开销&#xff0c;平衡网络负载&#xff0c;延长WSN生命周期。具体通过建立基于距离的能量消耗模型&am…...

postgresql|数据库|只读用户的创建和删除(备忘)

CREATE USER read_only WITH PASSWORD 密码 -- 连接到xxx数据库 \c xxx -- 授予对xxx数据库的只读权限 GRANT CONNECT ON DATABASE xxx TO read_only; GRANT USAGE ON SCHEMA public TO read_only; GRANT SELECT ON ALL TABLES IN SCHEMA public TO read_only; GRANT EXECUTE O…...

Spring Boot+Neo4j知识图谱实战:3步搭建智能关系网络!

一、引言 在数据驱动的背景下&#xff0c;知识图谱凭借其高效的信息组织能力&#xff0c;正逐步成为各行业应用的关键技术。本文聚焦 Spring Boot与Neo4j图数据库的技术结合&#xff0c;探讨知识图谱开发的实现细节&#xff0c;帮助读者掌握该技术栈在实际项目中的落地方法。 …...

AI编程--插件对比分析:CodeRider、GitHub Copilot及其他

AI编程插件对比分析&#xff1a;CodeRider、GitHub Copilot及其他 随着人工智能技术的快速发展&#xff0c;AI编程插件已成为提升开发者生产力的重要工具。CodeRider和GitHub Copilot作为市场上的领先者&#xff0c;分别以其独特的特性和生态系统吸引了大量开发者。本文将从功…...

大学生职业发展与就业创业指导教学评价

这里是引用 作为软工2203/2204班的学生&#xff0c;我们非常感谢您在《大学生职业发展与就业创业指导》课程中的悉心教导。这门课程对我们即将面临实习和就业的工科学生来说至关重要&#xff0c;而您认真负责的教学态度&#xff0c;让课程的每一部分都充满了实用价值。 尤其让我…...

基于matlab策略迭代和值迭代法的动态规划

经典的基于策略迭代和值迭代法的动态规划matlab代码&#xff0c;实现机器人的最优运输 Dynamic-Programming-master/Environment.pdf , 104724 Dynamic-Programming-master/README.md , 506 Dynamic-Programming-master/generalizedPolicyIteration.m , 1970 Dynamic-Programm…...

GO协程(Goroutine)问题总结

在使用Go语言来编写代码时&#xff0c;遇到的一些问题总结一下 [参考文档]&#xff1a;https://www.topgoer.com/%E5%B9%B6%E5%8F%91%E7%BC%96%E7%A8%8B/goroutine.html 1. main()函数默认的Goroutine 场景再现&#xff1a; 今天在看到这个教程的时候&#xff0c;在自己的电…...

第7篇:中间件全链路监控与 SQL 性能分析实践

7.1 章节导读 在构建数据库中间件的过程中&#xff0c;可观测性 和 性能分析 是保障系统稳定性与可维护性的核心能力。 特别是在复杂分布式场景中&#xff0c;必须做到&#xff1a; &#x1f50d; 追踪每一条 SQL 的生命周期&#xff08;从入口到数据库执行&#xff09;&#…...

ui框架-文件列表展示

ui框架-文件列表展示 介绍 UI框架的文件列表展示组件&#xff0c;可以展示文件夹&#xff0c;支持列表展示和图标展示模式。组件提供了丰富的功能和可配置选项&#xff0c;适用于文件管理、文件上传等场景。 功能特性 支持列表模式和网格模式的切换展示支持文件和文件夹的层…...

QT开发技术【ffmpeg + QAudioOutput】音乐播放器

一、 介绍 使用ffmpeg 4.2.2 在数字化浪潮席卷全球的当下&#xff0c;音视频内容犹如璀璨繁星&#xff0c;点亮了人们的生活与工作。从短视频平台上令人捧腹的搞笑视频&#xff0c;到在线课堂中知识渊博的专家授课&#xff0c;再到影视平台上扣人心弦的高清大片&#xff0c;音…...