搭建docker私有仓库
1、拉取registry镜像
docker pull registry
2、创建镜像存储目录
mkdir -p /opt/data/registry
3、 启动registry容器
docker run -d --name private_registry -p 5000:5000 -v /opt/data/registry:/var/lib/registry registry
4、查看宿主机ip
ip a
5、 修改配置文件
vim /etc/default/docker
DOCKER_OPTS="--registry-mirror=http://hub-mirror.c.163.com --insecure-registry host_ip:5000"
6、若无此文件,则修改另一文件
vim /etc/docker/daemon.josn
"insecure-registries" :["host_ip:5000"],
7、重新加载配置
systemctl reload docker
8、修改本地镜像tag
docker tag nginx-test host_ip:5000/nginx
9、上传本地镜像
docker push host_ip:5000/nginx
10、下载本地镜像
docker pull host_ip:5000/nginx
参考链接:https://docs.docker.com/engine/reference/commandline/dockerd/#daemon-configuration-file
参考链接:https://blog.csdn.net/tellmewhyto/article/details/80822188
参考链接:https://blog.csdn.net/qq_42114918/article/details/81609465