docker registry私有仓库
docker run -d --network host --restart=always --name baimei-registry -v /var/lib/registry registry
访问docker registry服务的WebUI,如上图所示:
http://10.0.0.101:5000/v2/_catalog
1.配置客戶端参数
[root@centos202 ~]# cat /etc/docker/daemon.json
{
"registry-mirrors": ["https://tuv7rqqq.mirror.aliyuncs.com"],
"cluster-store": "consul://10.0.0.211:8500",
"cluster-advertise": "10.0.0.202:7777",
"insecure-registries": ["10.0.0.211:5000","ubuntu211:5000"]
}
2.上传镜像到docker-registries私有仓库
docker tag alpine:latest 10.0.0.211:5000/baimei-alpine:v1
docker push 10.0.0.211:5000/baimei-alpine
3.下载镜像
docker pull 10.0.0.211:5000/baimei-alpine
4.删除镜像
1)删除源数据
docker exec baimei-registry rm -rf /var/lib/registry/docker/registry/v2/repositories/baimei-alpine
2)回收数据
docker exec baimei-registry registry garbage-collect /etc/docker/registry/config.yml
温馨提示:
当回收数据后,想要重新推送之前的旧镜像,需要重启docker registry镜像哟!否则无法重新推送之前推送的镜像哟!