前言
- docker yum旧版安装和新版安装改了名字,无法正常升级。
- 旧版安装docker 需要独立安装docker-compose,docker-compose不支持yum安装。
- docker-compose使用pip安装,遇到很多pip和py版本匹配问题。
- 注意。卸载前请保护自己的镜像
安装
//1.卸载旧版
// 注意。卸载前请保护自己的镜像
sudo yum remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-engine
//2.设置docker-ce yum源
sudo yum install -y yum-utils
sudo yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo
//3. 安装docker全家桶
sudo yum install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin
//4.启动docker
sudo systemctl start docker
校验
//1. 校验docker
docker version
//2. 校验docker compose
docker compose version
Client: Docker Engine - Community
Version: 20.10.18
API version: 1.41
Go version: go1.18.6
Git commit: b40c2f6
Built: Thu Sep 8 23:14:08 2022
OS/Arch: linux/amd64
Context: default
Experimental: true
Server: Docker Engine - Community
Engine:
Version: 20.10.18
API version: 1.41 (minimum version 1.12)
Go version: go1.18.6
Git commit: e42327a
Built: Thu Sep 8 23:12:21 2022
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.6.8
GitCommit: 9cd3357b7fd7218e4aec3eae239db1f68a5a6ec6
runc:
Version: 1.1.4
GitCommit: v1.1.4-0-g5fd4c4d
docker-init:
Version: 0.19.0
GitCommit: de40ad0
Docker Compose version v2.10.2
docker官方安装