如何将docker升级到最新版本
1、查找主机上关于Docker的软件包
# rpm -qa | grep docker – – 列出包含docker字段的软件的信息
docker-1.13.1-53.git774336d.el7.centos.x86_64
docker-client-1.13.1-53.git774336d.el7.centos.x86_64
docker-common-1.13.1-53.git774336d.el7.centos.x86_64
2、使用yum remove卸载软件
# yum remove docker-1.13.1-53.git774336d.el7.centos.x86_64
# yum remove docker-client-1.13.1-53.git774336d.el7.centos.x86_64
# yum remove docker-common-1.13.1-53.git774336d.el7.centos.x86_64
删除完毕,然后运行命令检查一下,在使用docker命令会提示docker不存在,删除完成。
没有该命令或者该目录
3、使用curl升级到最新版
# curl -fsSL https://get.docker.com/ | sh
4、重启Docker
# systemctl restart docker
5、设置Docker开机自启
# systemctl enable docker
6、查看Docker版本信息
# docker version 或者docker info
1 [root@laowang ~]# docker version 2 Client: Docker Engine - Community 3 Version: 19.03.13 4 API version: 1.40 5 Go version: go1.13.15 6 Git commit: 4484c46d9d 7 Built: Wed Sep 16 17:03:45 2020 8 OS/Arch: linux/amd64 9 Experimental: false 10 11 Server: Docker Engine - Community 12 Engine: 13 Version: 19.03.13 14 API version: 1.40 (minimum version 1.12) 15 Go version: go1.13.15 16 Git commit: 4484c46d9d 17 Built: Wed Sep 16 17:02:21 2020 18 OS/Arch: linux/amd64 19 Experimental: false 20 containerd: 21 Version: 1.3.7 22 GitCommit: 8fba4e9a7d01810a393d5d25a3621dc101981175 23 runc: 24 Version: 1.0.0-rc10 25 GitCommit: dc9208a3303feef5b3839f4323d9beb36df0a9dd 26 docker-init: 27 Version: 0.18.0 28 GitCommit: fec3683
7、使用docker images命令查看自己之前的镜像是否存在
#docker images
1
2
3
4
5
|
[root@localhost ~]# docker images REPOSITORY TAG IMAGE ID CREATED SIZE redis latest f0453552d7f2 7 months ago 98.2MB hello-world latest bf756fb1ae65 10 months ago 13.3kB hello-world <none> fce289e99eb9 22 months ago 1.84kB |
升级完成,大功告成,继续我们的微服务。
生活不止眼前的苟且,还有诗和远方