介绍
Registry是一个几种存放image并对外提供上传下载以及一系列API的服务。可以很容易和本地源代码以及远端Git服务的关系相对应。
搭建
1 2 3 4
|
docker run --name docker-registry -d -p 5000:5000 -e REGISTRY_STORAGE_DELETE_ENABLED=true -v /data/registry:/var/lib/registry registry
|
基本操作
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| curl -X GET http://<registry_ip>:<registry_port>/v2/_catalog
curl -X GET http://<registry_ip>:<registry_port>/v2/<image_name>/tags/list
ExecStart=/usr/bin/dockerd --insecure-registry=http://192.168.40.102:5000
sha=`ls /data/registry/docker/registry/v2/repositories/$image/_manifests/revisions/sha256`
curl -XDELETE http://<registryurl>/v2/$image/manifests/sha256:$sha
docker exec -it registry sh
registry garbage-collect /etc/docker/registry/config.yml
rm -rf /opt/registry/docker/registry/v2/repositories/$image
|