创建私有仓库
vim /etc/docker/daemon.json
//使用私有仓库运行容器 , 宿主机ip
{ "insecure-registries" : ["192.168.1.20:5000"] }
[root@docker01 ~]# systemctl restart docker [root@docker01 ~]# docker run -itd -p 5000:5000 registry:latest [root@docker01 ~]# curl http://192.168.1.21:5000/v2/
打标记上传
[root@docker01 ~]# docker tag busybox:latest 192.168.1.21:5000/busybox:latest [root@docker01 ~]# docker push 192.168.1.21:5000/busybox:latest
客户端
配置 daemon.json
重启 docker服务
启动运行容器
docker run -it 192.168.1.21:5000/myos:latest /bin/bash
curl http://192.168.1.21:5000/v2/_catalog # 查看镜像 curl http://192.168.1.21:5000/v2/<repo>/tags/list # 查看镜像标签
原文:https://www.cnblogs.com/ray-mmss/p/10401262.html