This post is also available in English and alternative languages.Linux Docker 升级步骤。
Docker版本升级步骤
1. 停止 docker 服务
如果出现 Failed to stop docker.service:Access denied
错误,运行 systemctl daemon-reexec
命令。
2. 查看当前版本
3. 卸载 docker 软件包
1 2 3 4 5 6 7 8
| sudo yum remove docker \ docker-client \ docker-client-latest \ docker-common \ docker-latest \ docker-latest-logrotate \ docker-logrotate \ docker-engine
|
4. 删除相关配置文件
1 2 3
| find /etc/systemd -name '*docker*' -exec rm -f {} \; rm -rf /var/lib/docker rm -rf /var/run/docker
|
5. 安装新版本Docker
1 2 3 4 5 6 7 8
| sudo yum install -y yum-utils sudo yum-config-manager \ --add-repo \ https://download.docker.com/linux/centos/docker-ce.repo
sudo yum install docker-ce docker-ce-cli containerd.io
|
6. 设置开机启动
1 2
| systemctl start docker systemctl enable docker
|
7. 查看Docker版本