安装docker-ce
此示例操作系统为CentOS 8,如果yum install containerd.io
有报错,根据错误提示去阿里云centos镜像站找合适的rpm包安装。
1
2
3
4
5
| sudo yum install -y yum-utils
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
sudo yum install -y docker-ce docker-ce-cli containerd.io
sudo systemctl start docker
sudo systemctl enable docker
|
阿里云镜像加速器
XXXXXXXX.mirror.aliyuncs.com
替换成自己的加速器地址,地址在下面给出的参考链接里查找。
1
2
3
4
5
6
7
8
| sudo tee /etc/docker/daemon.json <<-'EOF'
{
"registry-mirrors": ["https://XXXXXXXX.mirror.aliyuncs.com"]
}
EOF
sudo systemctl daemon-reload
sudo systemctl restart docker
|
参考链接:
https://docs.docker.com/engine/install/centos/
https://cr.console.aliyun.com/cn-shanghai/instances/mirrors # 需要登录阿里云