Docker删除私有仓库镜像
安装删除脚本
curl https://raw.githubusercontent.com/burnettk/delete-docker-registry-image/master/delete_docker_registry_image.py | sudo tee /usr/local/bin/delete_docker_registry_image >/dev/null
chmod a+x /usr/local/bin/delete_docker_registry_image
设置私有仓库目录环境变量
export REGISTRY_DATA_DIR=/opt/registry/docker/registry/v2
删除镜像
### 软删除
delete_docker_registry_image --image lokolla/centos-source-neutron-server --dry-run
### 硬删除(建议先关闭私有仓库)
docker stop registry
delete_docker_registry_image --image lokolla/centos-source-neutron-server
docker start registry
### 删除镜像tag
delete_docker_registry_image --image lokolla/centos-source-neutron-server:4.0.2
网友评论