1.查看docker原来的版本
# docker --version
Docker version 18.09.8, build 0dd43dd87f
2.安装20.10.12的版本
2.1安装yum-utils包(它提供了yum-config-manager实用程序)并设置稳定的存储库。
# sudo yum install -y yum-utils
Loaded plugins: fastestmirror
Repository 'kubernetes': Error parsing config: Error parsing "repo_gpgcheck = '0 # \xe8\xae\xbe\xe7\xbd\xae1\xe4\xbc\x9a\xe6\xa0\xa1\xe9\xaa\x8c\xe6\x8a\xa5\xe9\x94\x99'": invalid boolean value
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package yum-utils.noarch 0:1.1.31-53.el7 will be installed
--> Processing Dependency: python-kitchen for package: yum-utils-1.1.31-53.el7.noarch
--> Running transaction check
---> Package python-kitchen.noarch 0:1.1.1-5.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=========================================================================================================================================================
Package Arch Version Repository Size
=========================================================================================================================================================
Installing:
yum-utils noarch 1.1.31-53.el7 ai-local 122 k
Installing for dependencies:
python-kitchen noarch 1.1.1-5.el7 ai-local 267 k
Transaction Summary
=========================================================================================================================================================
Install 1 Package (+1 Dependent package)
Total download size: 388 k
Installed size: 1.7 M
Downloading packages:
(1/2): yum-utils-1.1.31-53.el7.noarch.rpm | 122 kB 00:00:00
(2/2): python-kitchen-1.1.1-5.el7.noarch.rpm | 267 kB 00:00:00
---------------------------------------------------------------------------------------------------------------------------------------------------------
Total 969 kB/s | 388 kB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : python-kitchen-1.1.1-5.el7.noarch 1/2
Installing : yum-utils-1.1.31-53.el7.noarch 2/2
Verifying : yum-utils-1.1.31-53.el7.noarch 1/2
Verifying : python-kitchen-1.1.1-5.el7.noarch 2/2
Installed:
yum-utils.noarch 0:1.1.31-53.el7
Dependency Installed:
python-kitchen.noarch 0:1.1.1-5.el7
Complete!
2.2 makecache
# yum makecache
Loaded plugins: fastestmirror
Repository 'kubernetes': Error parsing config: Error parsing "repo_gpgcheck = '0 # \xe8\xae\xbe\xe7\xbd\xae1\xe4\xbc\x9a\xe6\xa0\xa1\xe9\xaa\x8c\xe6\x8a\xa5\xe9\x94\x99'": invalid boolean value
Loading mirror speeds from cached hostfile
ai-local | 3.6 kB 00:00:00
docker-ce-stable | 3.5 kB 00:00:00
foot | 2.9 kB 00:00:00
paas | 2.9 kB 00:00:00
(1/4): docker-ce-stable/7/x86_64/updateinfo | 55 B 00:00:00
(2/4): docker-ce-stable/7/x86_64/filelists_db | 45 kB 00:00:00
(3/4): docker-ce-stable/7/x86_64/primary_db | 111 kB 00:00:00
(4/4): docker-ce-stable/7/x86_64/other_db | 133 kB 00:00:00
Metadata Cache Created
2.3 删除原来的包
# sudo yum remove docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-engine
Loaded plugins: fastestmirror
Repository 'kubernetes': Error parsing config: Error parsing "repo_gpgcheck = '0 # \xe8\xae\xbe\xe7\xbd\xae1\xe4\xbc\x9a\xe6\xa0\xa1\xe9\xaa\x8c\xe6\x8a\xa5\xe9\x94\x99'": invalid boolean value
No Match for argument: docker
No Match for argument: docker-client
No Match for argument: docker-client-latest
No Match for argument: docker-common
No Match for argument: docker-latest
No Match for argument: docker-latest-logrotate
No Match for argument: docker-logrotate
No Match for argument: docker-engine
No Packages marked for removal
2.4 安装指定的docker版本
# yum install docker-ce-20.10.12 docker-ce-cli-20.10.12 containerd.io
Loaded plugins: fastestmirror
Repository 'kubernetes': Error parsing config: Error parsing "repo_gpgcheck = '0 # \xe8\xae\xbe\xe7\xbd\xae1\xe4\xbc\x9a\xe6\xa0\xa1\xe9\xaa\x8c\xe6\x8a\xa5\xe9\x94\x99'": invalid boolean value
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package containerd.io.x86_64 0:1.2.6-3.3.el7 will be updated
---> Package containerd.io.x86_64 0:1.6.21-3.1.el7 will be an update
---> Package docker-ce.x86_64 3:18.09.8-3.el7 will be updated
---> Package docker-ce.x86_64 3:20.10.12-3.el7 will be an update
--> Processing Dependency: docker-ce-rootless-extras for package: 3:docker-ce-20.10.12-3.el7.x86_64
---> Package docker-ce-cli.x86_64 1:18.09.8-3.el7 will be updated
---> Package docker-ce-cli.x86_64 1:20.10.12-3.el7 will be an update
--> Processing Dependency: docker-scan-plugin(x86-64) for package: 1:docker-ce-cli-20.10.12-3.el7.x86_64
--> Running transaction check
---> Package docker-ce-rootless-extras.x86_64 0:24.0.2-1.el7 will be installed
--> Processing Dependency: fuse-overlayfs >= 0.7 for package: docker-ce-rootless-extras-24.0.2-1.el7.x86_64
--> Processing Dependency: slirp4netns >= 0.4 for package: docker-ce-rootless-extras-24.0.2-1.el7.x86_64
---> Package docker-scan-plugin.x86_64 0:0.23.0-3.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 slirp4netns.x86_64 0:0.4.3-4.el7_8 will be installed
--> Running transaction check
---> Package fuse3-libs.x86_64 0:3.6.1-4.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=========================================================================================================================================================
Package Arch Version Repository Size
=========================================================================================================================================================
Updating:
containerd.io x86_64 1.6.21-3.1.el7 docker-ce-stable 34 M
docker-ce x86_64 3:20.10.12-3.el7 docker-ce-stable 23 M
docker-ce-cli x86_64 1:20.10.12-3.el7 docker-ce-stable 30 M
Installing for dependencies:
docker-ce-rootless-extras x86_64 24.0.2-1.el7 docker-ce-stable 9.1 M
docker-scan-plugin x86_64 0.23.0-3.el7 docker-ce-stable 3.8 M
fuse-overlayfs x86_64 0.7.2-6.el7_8 paas 54 k
fuse3-libs x86_64 3.6.1-4.el7 paas 82 k
slirp4netns x86_64 0.4.3-4.el7_8 paas 81 k
Transaction Summary
=========================================================================================================================================================
Install ( 5 Dependent packages)
Upgrade 3 Packages
Total download size: 100 M
Is this ok [y/d/N]: y
Downloading packages:
No Presto metadata available for docker-ce-stable
warning: /var/cache/yum/x86_64/7/docker-ce-stable/packages/containerd.io-1.6.21-3.1.el7.x86_64.rpm: Header V4 RSA/SHA512 Signature, key ID 621e9f35: NOKEY
Public key for containerd.io-1.6.21-3.1.el7.x86_64.rpm is not installed
(1/8): containerd.io-1.6.21-3.1.el7.x86_64.rpm | 34 MB 00:00:03
(2/8): docker-ce-cli-20.10.12-3.el7.x86_64.rpm | 30 MB 00:00:03
(3/8): docker-ce-rootless-extras-24.0.2-1.el7.x86_64.rpm | 9.1 MB 00:00:01
(4/8): fuse-overlayfs-0.7.2-6.el7_8.x86_64.rpm | 54 kB 00:00:00
(5/8): fuse3-libs-3.6.1-4.el7.x86_64.rpm | 82 kB 00:00:00
(6/8): slirp4netns-0.4.3-4.el7_8.x86_64.rpm | 81 kB 00:00:00
(7/8): docker-ce-20.10.12-3.el7.x86_64.rpm | 23 MB 00:00:08
(8/8): docker-scan-plugin-0.23.0-3.el7.x86_64.rpm | 3.8 MB 00:00:00
---------------------------------------------------------------------------------------------------------------------------------------------------------
Total 12 MB/s | 100 MB 00:00:08
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
Installing : fuse3-libs-3.6.1-4.el7.x86_64 1/11
Installing : fuse-overlayfs-0.7.2-6.el7_8.x86_64 2/11
Installing : slirp4netns-0.4.3-4.el7_8.x86_64 3/11
Updating : containerd.io-1.6.21-3.1.el7.x86_64 4/11
Installing : docker-scan-plugin-0.23.0-3.el7.x86_64 5/11
Updating : 1:docker-ce-cli-20.10.12-3.el7.x86_64 6/11
Installing : docker-ce-rootless-extras-24.0.2-1.el7.x86_64 7/11
Updating : 3:docker-ce-20.10.12-3.el7.x86_64 8/11
/usr/bin/dockerd has not been configured as an alternative for dockerd
Cleanup : 3:docker-ce-18.09.8-3.el7.x86_64 9/11
Cleanup : containerd.io-1.2.6-3.3.el7.x86_64 10/11
Cleanup : 1:docker-ce-cli-18.09.8-3.el7.x86_64 11/11
Verifying : docker-scan-plugin-0.23.0-3.el7.x86_64 1/11
Verifying : 1:docker-ce-cli-20.10.12-3.el7.x86_64 2/11
Verifying : fuse-overlayfs-0.7.2-6.el7_8.x86_64 3/11
Verifying : containerd.io-1.6.21-3.1.el7.x86_64 4/11
Verifying : slirp4netns-0.4.3-4.el7_8.x86_64 5/11
Verifying : fuse3-libs-3.6.1-4.el7.x86_64 6/11
Verifying : docker-ce-rootless-extras-24.0.2-1.el7.x86_64 7/11
Verifying : 3:docker-ce-20.10.12-3.el7.x86_64 8/11
Verifying : containerd.io-1.2.6-3.3.el7.x86_64 9/11
Verifying : 1:docker-ce-cli-18.09.8-3.el7.x86_64 10/11
Verifying : 3:docker-ce-18.09.8-3.el7.x86_64 11/11
Dependency Installed:
docker-ce-rootless-extras.x86_64 0:24.0.2-1.el7 docker-scan-plugin.x86_64 0:0.23.0-3.el7 fuse-overlayfs.x86_64 0:0.7.2-6.el7_8
fuse3-libs.x86_64 0:3.6.1-4.el7 slirp4netns.x86_64 0:0.4.3-4.el7_8
Updated:
containerd.io.x86_64 0:1.6.21-3.1.el7 docker-ce.x86_64 3:20.10.12-3.el7 docker-ce-cli.x86_64 1:20.10.12-3.el7
Complete!
2.5 查看,docker版本
# docker --version
Docker version 20.10.12, build e91ed57
文章来源地址https://www.toymoban.com/news/detail-475785.html
文章来源:https://www.toymoban.com/news/detail-475785.html
到了这里,关于linux doker版本从18.09.8安装升级到20.10.12的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!