最近项目一直在往docker镜像化做迁移,为此做一些技术文档记录,只留干货,避免掉坑
- 系统:centos7.6
- docker: 最新
yum update
yum install -y yum-utils device-mapper-persistent-data lvm2
#阿里云镜像
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
#原镜像二选一
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
yum -y install docker-ce
docker -v
systemctl start docker && systemctl enable docker
docker version
docker images
vi /etc/docker/daemon.json
{
"registry-mirrors": [
"https://registry.docker-cn.com",
"http://hub-mirror.c.163.com",
"https://docker.mirrors.ustc.edu.cn",
"https://dockerhub.azk8s.cn",
"https://mirror.ccs.tencentyun.com",
"https://registry.cn-hangzhou.aliyuncs.com",
"https://docker.mirrors.ustc.edu.cn"
]
}
#加载文件
systemctl daemon-reload
#重启docker
systemctl restart docker.service