创建私有仓库
1. 服务端
docker pull registry
docker run -d -v /home/docker/registry:/var/lib/registry -p 5000:5000
--restart=always --privileged=true --name registry registry:last 基于私有仓库镜像运行容器
http://192.168.235.128:5000/v2/ 或 curl 192.168.235.128:5000/v2/_catalog 查看运行
vim /etc/docker/daemon.json
{"insecure-registries":["192.168.235.128:5000"]}
systemctl daemon-reload
systemctl restart docker重启
docker images 查看镜像
docker tag httpd 192.168.248.128:5000/httpd:v1.0 修改标签
docker push 192.168.235.128:5000/httpd:v1.0 上传
curl 192.168.235.128:5000/v2/httpd/tags/list 查看
2. 客户端
vim /etc/docker/daemon.json
{"insecure-registries":["192.168.235.128:5000"]}
systemctl daemon-reload
systemctl restart docker 重启
docker pull 192.168.235.128:5000/httpd:v1.0 拉取镜像
docker tag busybox 192.168.235.128:5000/busybox111:v1.0
docker push 192.168.235.128:5000/busybox111:v1.0 上传镜像