一、下载registry
[root@localhost ~]# docker pull registry
二、修改文件
进入daemon.json,在加速文件内添加私有仓库的地址
[root@localhost ~]# vim /etc/docker/daemon.json
{
“insecure-registries”:[“192.168.200.13:5000”],
“registry-mirrors”: [“https://mzdg1ru3.mirror.aliyuncs.com”]
}
三、重启docke服务
[root@localhost ~]# systemctl restart docker
四、启动并宿主机与容器之间挂载目录
[root@localhost ~]# docker run -d -p 5000:5000 -v /data/registry/:/tmp/registry registry
五、更改容器镜像标签
[root@localhost ~]# docker tag nginx:latest 192.168.200.13:5000/nginx1
六、上传
[root@localhost ~]# docker push 192.168.200.13:5000/nginx1
[root@localhost ~]# curl -XGET 192.168.200.13:5000/v2/_catalog
七、测试下载
[root@localhost ~]# docker pull 192.168.200.13:5000/nginx1