centos7安装docker

2021-03-08


[root@VM_0_13_centos ~]# cat /etc/redhat-release

CentOS Linux release 7.6.1810 (Core)



[root@VM_0_13_centos ~]# yum install -y yum-utils device-mapper-persistent-data lvm2

error: rpmdb: BDB0113 Thread/process 8268/139779486173248 failed: BDB1507 Thread died in Berkeley DB library

error: db5 error(-30973) from dbenv->failchk: BDB0087 DB_RUNRECOVERY: Fatal error, run database recovery

error: cannot open Packages index using db5 -  (-30973)

error: cannot open Packages database in /var/lib/rpm

CRITICAL:yum.main:


Error: rpmdb open failed


[root@VM_0_13_centos ~]# yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo

error: rpmdb: BDB0113 Thread/process 8268/139779486173248 failed: BDB1507 Thread died in Berkeley DB library

error: db5 error(-30973) from dbenv->failchk: BDB0087 DB_RUNRECOVERY: Fatal error, run database recovery

error: cannot open Packages index using db5 -  (-30973)

error: cannot open Packages database in /var/lib/rpm

CRITICAL:yum.cli:Yum Error: Error: rpmdb open failed

[root@VM_0_13_centos ~]# rpm --rebuilddb

[root@VM_0_13_centos ~]# yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo

Loaded plugins: fastestmirror, langpacks

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


[root@VM_0_13_centos ~]# yum list docker-ce --showduplicates | sort -r

Loaded plugins: fastestmirror, langpacks

docker-ce.x86_64            3:20.10.5-3.el7                     docker-ce-stable

docker-ce.x86_64            3:20.10.4-3.el7                     docker-ce-stable

docker-ce.x86_64            3:20.10.3-3.el7                     docker-ce-stable

docker-ce.x86_64            3:20.10.2-3.el7                     docker-ce-stable

docker-ce.x86_64            3:20.10.1-3.el7                     docker-ce-stable

docker-ce.x86_64            3:20.10.0-3.el7                     docker-ce-stable

docker-ce.x86_64            3:19.03.9-3.el7                     docker-ce-stable

docker-ce.x86_64            3:19.03.8-3.el7                     docker-ce-stable

docker-ce.x86_64            3:19.03.7-3.el7                     docker-ce-stable

docker-ce.x86_64            3:19.03.6-3.el7                     docker-ce-stable

docker-ce.x86_64            3:19.03.5-3.el7                     docker-ce-stable

docker-ce.x86_64            3:19.03.4-3.el7                     docker-ce-stable

docker-ce.x86_64            3:19.03.3-3.el7                     docker-ce-stable

docker-ce.x86_64            3:19.03.2-3.el7                     docker-ce-stable

docker-ce.x86_64            3:19.03.15-3.el7                    docker-ce-stable

docker-ce.x86_64            3:19.03.14-3.el7                    docker-ce-stable

docker-ce.x86_64            3:19.03.1-3.el7                     docker-ce-stable

docker-ce.x86_64            3:19.03.13-3.el7                    docker-ce-stable

docker-ce.x86_64            3:19.03.12-3.el7                    docker-ce-stable

docker-ce.x86_64            3:19.03.11-3.el7                    docker-ce-stable

docker-ce.x86_64            3:19.03.10-3.el7                    docker-ce-stable

docker-ce.x86_64            3:19.03.0-3.el7                     docker-ce-stable

docker-ce.x86_64            3:18.09.9-3.el7                     docker-ce-stable

docker-ce.x86_64            3:18.09.8-3.el7                     docker-ce-stable

docker-ce.x86_64            3:18.09.7-3.el7                     docker-ce-stable

docker-ce.x86_64            3:18.09.6-3.el7                     docker-ce-stable

docker-ce.x86_64            3:18.09.5-3.el7                     docker-ce-stable

docker-ce.x86_64            3:18.09.4-3.el7                     docker-ce-stable

docker-ce.x86_64            3:18.09.3-3.el7                     docker-ce-stable

docker-ce.x86_64            3:18.09.2-3.el7                     docker-ce-stable

docker-ce.x86_64            3:18.09.1-3.el7                     docker-ce-stable

docker-ce.x86_64            3:18.09.0-3.el7                     docker-ce-stable

docker-ce.x86_64            18.06.3.ce-3.el7                    docker-ce-stable

docker-ce.x86_64            18.06.2.ce-3.el7                    docker-ce-stable

docker-ce.x86_64            18.06.1.ce-3.el7                    docker-ce-stable

docker-ce.x86_64            18.06.0.ce-3.el7                    docker-ce-stable

docker-ce.x86_64            18.03.1.ce-1.el7.centos             docker-ce-stable

docker-ce.x86_64            18.03.0.ce-1.el7.centos             docker-ce-stable

docker-ce.x86_64            17.12.1.ce-1.el7.centos             docker-ce-stable

docker-ce.x86_64            17.12.0.ce-1.el7.centos             docker-ce-stable

docker-ce.x86_64            17.09.1.ce-1.el7.centos             docker-ce-stable

docker-ce.x86_64            17.09.0.ce-1.el7.centos             docker-ce-stable

docker-ce.x86_64            17.06.2.ce-1.el7.centos             docker-ce-stable

docker-ce.x86_64            17.06.1.ce-1.el7.centos             docker-ce-stable

docker-ce.x86_64            17.06.0.ce-1.el7.centos             docker-ce-stable

docker-ce.x86_64            17.03.3.ce-1.el7                    docker-ce-stable

docker-ce.x86_64            17.03.2.ce-1.el7.centos             docker-ce-stable

docker-ce.x86_64            17.03.1.ce-1.el7.centos             docker-ce-stable

docker-ce.x86_64            17.03.0.ce-1.el7.centos             docker-ce-stable

Determining fastest mirrors

Available Packages

[root@VM_0_13_centos ~]# yum install docker-ce

Loaded plugins: fastestmirror, langpacks

Loading mirror speeds from cached hostfile

Resolving Dependencies

--> Running transaction check

---> Package docker-ce.x86_64 3:20.10.5-3.el7 will be installed

--> Processing Dependency: container-selinux >= 2:2.74 for package: 3:docker-ce-20.10.5-3.el7.x86_64

--> Processing Dependency: containerd.io >= 1.4.1 for package: 3:docker-ce-20.10.5-3.el7.x86_64

--> Processing Dependency: docker-ce-cli for package: 3:docker-ce-20.10.5-3.el7.x86_64

--> Processing Dependency: docker-ce-rootless-extras for package: 3:docker-ce-20.10.5-3.el7.x86_64

--> Processing Dependency: libcgroup for package: 3:docker-ce-20.10.5-3.el7.x86_64

--> Running transaction check

---> Package container-selinux.noarch 2:2.119.2-1.911c772.el7_8 will be installed

--> Processing Dependency: policycoreutils-python for package: 2:container-selinux-2.119.2-1.911c772.el7_8.noarch

---> Package containerd.io.x86_64 0:1.4.3-3.1.el7 will be installed

---> Package docker-ce-cli.x86_64 1:20.10.5-3.el7 will be installed

---> Package docker-ce-rootless-extras.x86_64 0:20.10.5-3.el7 will be installed

--> Processing Dependency: fuse-overlayfs >= 0.7 for package: docker-ce-rootless-extras-20.10.5-3.el7.x86_64

--> Processing Dependency: slirp4netns >= 0.4 for package: docker-ce-rootless-extras-20.10.5-3.el7.x86_64

---> 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 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-python.x86_64 0:2.5-14.el7 will be installed

---> Package policycoreutils.x86_64 0:2.5-29.el7_6.1 will be updated

---> Package policycoreutils.x86_64 0:2.5-34.el7 will be an update

---> 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.4-4.el7 will be updated

--> Processing Dependency: audit-libs(x86-64) = 2.8.4-4.el7 for package: audit-2.8.4-4.el7.x86_64

---> Package audit-libs.x86_64 0:2.8.5-4.el7 will be an update

--> Running transaction check

---> Package audit.x86_64 0:2.8.4-4.el7 will be updated

---> Package audit.x86_64 0:2.8.5-4.el7 will be an update

--> Finished Dependency Resolution


Dependencies Resolved


================================================================================

 Package                Arch   Version                   Repository        Size

================================================================================

Installing:

 docker-ce              x86_64 3:20.10.5-3.el7           docker-ce-stable  27 M

Installing for dependencies:

 audit-libs-python      x86_64 2.8.5-4.el7               os                76 k

 checkpolicy            x86_64 2.5-8.el7                 os               295 k

 container-selinux      noarch 2:2.119.2-1.911c772.el7_8 extras            40 k

 containerd.io          x86_64 1.4.3-3.1.el7             docker-ce-stable  33 M

 docker-ce-cli          x86_64 1:20.10.5-3.el7           docker-ce-stable  33 M

 docker-ce-rootless-extras

                        x86_64 20.10.5-3.el7             docker-ce-stable 9.1 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               os                66 k

 libsemanage-python     x86_64 2.5-14.el7                os               113 k

 policycoreutils-python x86_64 2.5-34.el7                os               457 k

 python-IPy             noarch 0.75-6.el7                os                32 k

 setools-libs           x86_64 3.3.8-4.el7               os               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               os               256 k

 audit-libs             x86_64 2.8.5-4.el7               os               102 k

 policycoreutils        x86_64 2.5-34.el7                os               917 k


Transaction Summary

================================================================================

Install  1 Package  (+14 Dependent packages)

Upgrade             (  3 Dependent packages)


Total download size: 105 M

Is this ok [y/d/N]: y

Downloading packages:

No Presto metadata available for os

(1/18): audit-libs-2.8.5-4.el7.x86_64.rpm                  | 102 kB   00:00

(2/18): audit-2.8.5-4.el7.x86_64.rpm                       | 256 kB   00:00

(3/18): audit-libs-python-2.8.5-4.el7.x86_64.rpm           |  76 kB   00:00

(4/18): checkpolicy-2.5-8.el7.x86_64.rpm                   | 295 kB   00:00

(5/18): container-selinux-2.119.2-1.911c772.el7_8.noarch.r |  40 kB   00:00

warning: /var/cache/yum/x86_64/7/docker-ce-stable/packages/containerd.io-1.4.3-3.1.el7.x86_64.rpm: Header V4 RSA/SHA512 Signature, key ID 621e9f35: NOKEY

Public key for containerd.io-1.4.3-3.1.el7.x86_64.rpm is not installed

(6/18): containerd.io-1.4.3-3.1.el7.x86_64.rpm             |  33 MB   00:11

(7/18): docker-ce-cli-20.10.5-3.el7.x86_64.rpm             |  33 MB   00:11

(8/18): fuse-overlayfs-0.7.2-6.el7_8.x86_64.rpm            |  54 kB   00:00

(9/18): libcgroup-0.41-21.el7.x86_64.rpm                   |  66 kB   00:00

(10/18): libsemanage-python-2.5-14.el7.x86_64.rpm          | 113 kB   00:00

(11/18): fuse3-libs-3.6.1-4.el7.x86_64.rpm                 |  82 kB   00:00

(12/18): docker-ce-20.10.5-3.el7.x86_64.rpm                |  27 MB   00:23

(13/18): policycoreutils-python-2.5-34.el7.x86_64.rpm      | 457 kB   00:00

(14/18): policycoreutils-2.5-34.el7.x86_64.rpm             | 917 kB   00:00

(15/18): python-IPy-0.75-6.el7.noarch.rpm                  |  32 kB   00:00

(16/18): setools-libs-3.3.8-4.el7.x86_64.rpm               | 620 kB   00:00

(17/18): slirp4netns-0.4.3-4.el7_8.x86_64.rpm              |  81 kB   00:00

(18/18): docker-ce-rootless-extras-20.10.5-3.el7.x86_64.rp | 9.1 MB   00:02

--------------------------------------------------------------------------------

Total                                              4.0 MB/s | 105 MB  00:26

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   : audit-libs-2.8.5-4.el7.x86_64                               1/21

  Updating   : policycoreutils-2.5-34.el7.x86_64                           2/21

  Installing : libcgroup-0.41-21.el7.x86_64                                3/21

  Installing : audit-libs-python-2.8.5-4.el7.x86_64                        4/21

  Installing : setools-libs-3.3.8-4.el7.x86_64                             5/21

  Installing : checkpolicy-2.5-8.el7.x86_64                                6/21

  Installing : python-IPy-0.75-6.el7.noarch                                7/21

  Installing : slirp4netns-0.4.3-4.el7_8.x86_64                            8/21

  Installing : libsemanage-python-2.5-14.el7.x86_64                        9/21

  Installing : policycoreutils-python-2.5-34.el7.x86_64                   10/21

  Installing : 2:container-selinux-2.119.2-1.911c772.el7_8.noarch         11/21

setsebool:  SELinux is disabled.

  Installing : containerd.io-1.4.3-3.1.el7.x86_64                         12/21

  Installing : fuse3-libs-3.6.1-4.el7.x86_64                              13/21

  Installing : fuse-overlayfs-0.7.2-6.el7_8.x86_64                        14/21

  Installing : 1:docker-ce-cli-20.10.5-3.el7.x86_64                       15/21

  Installing : docker-ce-rootless-extras-20.10.5-3.el7.x86_64             16/21

  Installing : 3:docker-ce-20.10.5-3.el7.x86_64                           17/21

  Updating   : audit-2.8.5-4.el7.x86_64                                   18/21

  Cleanup    : policycoreutils-2.5-29.el7_6.1.x86_64                      19/21

  Cleanup    : audit-2.8.4-4.el7.x86_64                                   20/21

  Cleanup    : audit-libs-2.8.4-4.el7.x86_64                              21/21

  Verifying  : 1:docker-ce-cli-20.10.5-3.el7.x86_64                        1/21

  Verifying  : audit-libs-2.8.5-4.el7.x86_64                               2/21

  Verifying  : fuse3-libs-3.6.1-4.el7.x86_64                               3/21

  Verifying  : audit-2.8.5-4.el7.x86_64                                    4/21

  Verifying  : policycoreutils-2.5-34.el7.x86_64                           5/21

  Verifying  : fuse-overlayfs-0.7.2-6.el7_8.x86_64                         6/21

  Verifying  : libsemanage-python-2.5-14.el7.x86_64                        7/21

  Verifying  : slirp4netns-0.4.3-4.el7_8.x86_64                            8/21

  Verifying  : 2:container-selinux-2.119.2-1.911c772.el7_8.noarch          9/21

  Verifying  : python-IPy-0.75-6.el7.noarch                               10/21

  Verifying  : 3:docker-ce-20.10.5-3.el7.x86_64                           11/21

  Verifying  : checkpolicy-2.5-8.el7.x86_64                               12/21

  Verifying  : docker-ce-rootless-extras-20.10.5-3.el7.x86_64             13/21

  Verifying  : policycoreutils-python-2.5-34.el7.x86_64                   14/21

  Verifying  : audit-libs-python-2.8.5-4.el7.x86_64                       15/21

  Verifying  : containerd.io-1.4.3-3.1.el7.x86_64                         16/21

  Verifying  : setools-libs-3.3.8-4.el7.x86_64                            17/21

  Verifying  : libcgroup-0.41-21.el7.x86_64                               18/21

  Verifying  : policycoreutils-2.5-29.el7_6.1.x86_64                      19/21

  Verifying  : audit-libs-2.8.4-4.el7.x86_64                              20/21

  Verifying  : audit-2.8.4-4.el7.x86_64                                   21/21


Installed:

  docker-ce.x86_64 3:20.10.5-3.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

  containerd.io.x86_64 0:1.4.3-3.1.el7

  docker-ce-cli.x86_64 1:20.10.5-3.el7

  docker-ce-rootless-extras.x86_64 0:20.10.5-3.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

  policycoreutils.x86_64 0:2.5-34.el7


Complete!

[root@VM_0_13_centos ~]# systemctl start docker

[root@VM_0_13_centos ~]# systemctl enable docker

Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service.

[root@VM_0_13_centos ~]# docker version

Client: Docker Engine - Community

 Version:           20.10.5

 API version:       1.41

 Go version:        go1.13.15

 Git commit:        55c4c88

 Built:             Tue Mar  2 20:33:55 2021

 OS/Arch:           linux/amd64

 Context:           default

 Experimental:      true


Server: Docker Engine - Community

 Engine:

  Version:          20.10.5

  API version:      1.41 (minimum version 1.12)

  Go version:       go1.13.15

  Git commit:       363e9a8

  Built:            Tue Mar  2 20:32:17 2021

  OS/Arch:          linux/amd64

  Experimental:     false

 containerd:

  Version:          1.4.3

  GitCommit:        269548fa27e0089a8b8278fc4fc781d7f65a939b

 runc:

  Version:          1.0.0-rc92

  GitCommit:        ff819c7e9184c13b7c2607fe6c30ae19403a7aff

 docker-init:

  Version:          0.19.0

  GitCommit:        de40ad0


联系信息

QQ:1827566828
Email: 1827566828@qq.com
Web: https://www.yynet.wang

留言