docker.com官网安装
https://docs.docker.com/engine/install/centos/
sudo yum remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-engine
sudo yum install -y yum-utils
默认是国外的:
sudo yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo
华为云:
sudo yum-config-manager \
--add-repo \
https://repo.huaweicloud.com/dockerce/linux/centos/docker-ce.repo
yum clean all && yum makecache
yum install docker-ce docker-ce-cli containerd.io -y
打开阿里云官网 产品 --> 容器与中间件 --> 容器与镜像服务ACR --> 管理控制台 --> 镜像加速器 --> CentOS
sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-'EOF'
{
"registry-mirrors": ["https://vf52ltmx.mirror.aliyuncs.com"]
}
EOF
sudo systemctl daemon-reload
sudo systemctl restart docker
[root@web01 ~]
......
Network: bridge host ipvlan macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
ID: 7KGO:T7GI:5HJX:QIWP:MEFR:JHH5:6W37:6MNG:RBHV:ND6M:D24O:FJGI
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
......
扩展:docker卸载
yum remove docker-ce docker-ce-cli containerd.io
rm -rf /var/lib/docker
- 登录阿里云找到容器镜像服务
- 找到镜像加速地址
- 配置使用
|