其他分享
首页 > 其他分享> > docker发布自定义镜像到私有仓库

docker发布自定义镜像到私有仓库

作者:互联网

docker pull registry
docker run -d -p 5000:5000 -v /home/registry/:/temp/registry --name myregistry --privileged=true registry
curl -XGET http://192.168.32.100:5000/v2/_catalog

#返回
{"repositories":[]}

修改 /etc/docker/daemon.json 文件。

{
  "registry-mirrors": ["https://cawn2yly.mirror.aliyuncs.com"],
  "insecure-registries":["192.168.32.100:5000"]
}

修改后重启docker

sudo systemctl daemon-reload
sudo systemctl restart docker
docker tag 860b610b6aaa 192.168.32.100:5000/ubuntunettools:1.0.0
docker push 192.168.32.100:5000/ubuntunettools:1.0.0

成功后,可再次验证私服,看看repositories参数是否有变化。

docker pull 192.168.32.100:5000/ubuntunettools:1.0.0

标签:5000,自定义,私服,192.168,registry,镜像,docker,32.100
来源: https://www.cnblogs.com/lixingwu/p/16478029.html