docker发布自定义镜像到私有仓库
作者:互联网
- 运行registry私服
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":[]}
- 启用本地http推送,registry默认只能使用https
修改 /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