CentOS7如何将Docker升级到最新版
1.查找主机上关于Docker的软件包
# rpm -qa | grep docker – – 列出包含docker字段的软件的信息 docker-ce-18.09.2-3.el7.x86_64 docker-ce-cli-18.09.2-3.el7.x86_64
2.使用yum remove卸载软件
# yum remove docker-ce-18.09.2-3.el7.x86_64 # yum removedocker-ce-cli-18.09.2-3.el7.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 -v Docker version 19.03.5, build 633a0ea
7.查看Docker系统信息,包括镜像和容器数…
# docker info Client: Debug Mode: false Server: Containers: 4 Running: 0 Paused: 0 Stopped: 4 Images: 8 Server Version: 19.03.5 Storage Driver: overlay2 Backing Filesystem: xfs Supports d_type: true Native Overlay Diff: true Logging Driver: json-file Cgroup Driver: cgroupfs Plugins: Volume: local Network: bridge host ipvlan macvlan null overlay Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog Swarm: inactive Runtimes: runc Default Runtime: runc Init Binary: docker-init containerd version: 9754871865f7fe2f4e74d43e2fc7ccd237edcbce runc version: 09c8266bf2fcf9519a651b04ae54c967b9ab86ec init version: fec3683 Security Options: seccomp Profile: default Kernel Version: 3.10.0-957.el7.x86_64 Operating System: CentOS Linux 7 (Core) OSType: linux Architecture: x86_64 CPUs: 2 Total Memory: 1.777GiB Name: centos7.5 ID: MN2D:UKMO:X2CB:FSQ3:FZYS:QB27:TEHX:QLUZ:GKZH:ALJB:GZK6:YRKF Docker Root Dir: /var/lib/docker Debug Mode: false Registry: https://index.docker.io/v1/ Labels: Experimental: false Insecure Registries: 127.0.0.0/8 Live Restore Enabled: false WARNING: bridge-nf-call-iptables is disabled WARNING: bridge-nf-call-ip6tables is disabled
8.使用docker images命令查看自己之前的镜像是否存在
# docker images REPOSITORY TAG IMAGE ID CREATED SIZE keycloak 20190709 e9c4622f7a4a 4 months ago 859MB zentao 22 0f79e9c210cb 5 months ago 682MB elasticsearch 6.5.4 93109ce1d590 11 months ago 774MB mysql 5.7 563a026a1511 15 months ago 372MB