如何删除私有registry中的image

1. Login to the container
docker exec -it registry sh


2. Define variables matching your container and container version:
export NAME="imagename"
export VERSION="imageversion"


3. Move to the the registry directory:
cd /var/lib/registry/docker/registry/v2


4. Delete files related to your hash:
find . | grep `ls ./repositories/$NAME/_manifests/tags/$VERSION/index/sha256`| xargs rm -rf $1


5. Delete manifests:
rm -rf ./repositories/$NAME/_manifests/tags/$VERSION


6. Logout
exit

上一篇:Git的配置(内含设置GitHub及Gitee的SSH密钥)


下一篇:Java 高效检查一个数组中是否包含某个值