CentOS7アップグレードDockerバージョン

サーバープラットフォーム:
VMware®Workstation15Pro(15.5.2ビルド-15785246)
CentOS7(3.10.0-957.el7.x86_64)

1.インストールされているDockerパッケージを見つけます

rpm -qa | grep docker
---------------------------------------------------------------
[root@localhost ~]# rpm -qa | grep docker
docker-ce-18.06.1.ce-3.el7.x86_64

2.対応するソフトウェアをアンインストールします

yum remove xxx
---------------------------------------------------------------
[root@localhost ~]# yum remove docker-ce-18.06.1.ce-3.el7.x86_64
Loaded plugins: fastestmirror, langpacks, versionlock
Resolving Dependencies
--> Running transaction check
......

削除が完了したら、最初のコマンドを実行して確認します。

3.最新バージョンにアップグレードします

curl -fsSL https://get.docker.com/|sh
---------------------------------------------------------------
[root@localhost ~]# curl -fsSL https://get.docker.com/|sh
# Executing docker install script, commit: 3d8fe77c2c46c5b7571f94b42793905e5b3e42e4
+ sh -c 'yum install -y -q yum-utils'
Package yum-utils-1.1.31-54.el7_8.noarch already installed and latest version
+ sh -c 'yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo'
Loaded plugins: fastestmirror, langpacks, versionlock
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
+ '[' stable '!=' stable ']'
+ sh -c 'yum makecache'
Loaded plugins: fastestmirror, langpacks, versionlock
Loading mirror speeds from cached hostfile
epel/x86_64/metalink                                                                                                                                                      | 6.3 kB  00:00:00
 * base: mirrors.aliyun.com
 * epel: mirrors.bfsu.edu.cn
 * extras: mirrors.aliyun.com
 * updates: mirrors.aliyun.com
base                                                                                                                                                                      | 3.6 kB  00:00:00
docker-ce-stable                                                                                                                                                          | 3.5 kB  00:00:00
extras                                                                                                                                                                    | 2.9 kB  00:00:00
updates                                                                                                                                                                   | 2.9 kB  00:00:00
(1/6): epel/x86_64/prestodelta
......

4.Dockerを再起動します

systemctl restart docker

5.起動を設定します

systemctl enable docker

6.Dockerのバージョン情報を表示する

docker version		# 不需要启动 docker
docker --version	# 必须启动 docker
---------------------------------------------------------------
[root@localhost ~]# docker --version
Docker version 20.10.1, build 831ebea

7.前の画像を表示します

docker images
---------------------------------------------------------------
[root@localhost ~]# docker images
REPOSITORY                                         TAG                             IMAGE ID       CREATED         SIZE
mongo                                              latest                          3068f6bb852e   12 days ago     493MB
rabbitmq                                           3-management                    41f7a13e37d3   13 days ago     186MB
10.10.0.238:85/tensquare/tensquare_eureka_server   latest                          bd5cf2311b90   8 weeks ago     150MB
10.10.0.238:85/tensquare/tensquare_gathering       latest                          80bc06543a86   2 months ago    156MB
10.10.0.238:85/tensquare/tensquare_admin_service   latest                          39cc8c116eb7   2 months ago    158MB
10.10.0.238:85/tensquare/tensquare_zuul            latest                          b7752bde550a   2 months ago    147MB
eureka                                             v1                              3205689e8553   2 months ago    150MB
10.10.0.238:85/tensquare/eureka                    v2                              aa950e6e0916   2 months ago    150MB
goharbor/chartmuseum-photon                        v0.9.0-v1.9.2                   06f0bb43a123 
......

おめでとうございます、アップグレードは成功しました。

おすすめ

転載: blog.csdn.net/weixin_43298913/article/details/111593845