docker registry删除镜像
docker配置文件 /etc/docker/daemon.jsoninsecure-registries[root@hadoop03 k8s]# cat /etc/docker/daemon.json{"registry-mirrors": ["https://registry.docker-cn.com"],"exec-opts": ["native.cgroupdriver=systemd"
·
docker配置文件 /etc/docker/daemon.json
insecure-registries
[root@hadoop03 k8s]# cat /etc/docker/daemon.json
{
"registry-mirrors": ["https://registry.docker-cn.com"],
"exec-opts": ["native.cgroupdriver=systemd"],
"insecure-registries": ["hadoop03:5000"]
}
[hadoop@hadoop03 ~]$ curl hadoop03:5000/v2/_catalog
{"repositories":["busybox","coredns","etcd","flannel","gluster-centos","heketi","kube-apiserver","kube-controller-manager","kube-proxy","kube-scheduler","mirrored-flannelcni-flannel-cni-plugin","nginx","pause"]}
### 查看镜像版本
[hadoop@hadoop03 ~]$ curl -XGET hadoop03:5000/v2/coredns/tags/list
{"name":"coredns","tags":["v1.8.4"]}
###
[root@hadoop03 hadoop]# curl --header "Accept: application/vnd.docker.distribution.manifest.v2+json"anifests/latest
HTTP/1.1 200 OK
Content-Length: 1570
Content-Type: application/vnd.docker.distribution.manifest.v2+json
Docker-Content-Digest: sha256:ee89b00528ff4f02f2405e4ee221743ebc3f8e8dd0bfd5c4c20a2fa2aaa7ede3
Docker-Distribution-Api-Version: registry/2.0
Etag: "sha256:ee89b00528ff4f02f2405e4ee221743ebc3f8e8dd0bfd5c4c20a2fa2aaa7ede3"
X-Content-Type-Options: nosniff
Date: Thu, 27 Jan 2022 06:21:43 GMT
### 删除仓库镜像
[root@hadoop03 hadoop]# curl -I -X DELETE http://hadoop03:5000/v2/nginx/manifests/ee89b00528ff4f02f24de3
HTTP/1.1 405 Method Not Allowed
Content-Type: application/json; charset=utf-8
Docker-Distribution-Api-Version: registry/2.0
X-Content-Type-Options: nosniff
Date: Thu, 27 Jan 2022 06:22:20 GMT
Content-Length: 78
[root@hadoop03 hadoop]# curl -I -X DELETE http://hadoop03:5000/v2/nginx/manifests/sha256:ee89b00528ff4f02f2405e4ee221743ebc3f8e8dd0bfd5c4c20a2fa2aaa7ede3
HTTP/1.1 405 Method Not Allowed
Content-Type: application/json; charset=utf-8
Docker-Distribution-Api-Version: registry/2.0
X-Content-Type-Options: nosniff
Date: Thu, 27 Jan 2022 06:28:05 GMT
Content-Length: 78
[root@hadoop03 hadoop]# docker exec -it registry sh / # cat /etc/docker/registry/config.yml
version: 0.1
log:
fields:
service: registry
storage:
cache:
blobdescriptor: inmemory
filesystem:
rootdirectory: /var/lib/registry
delete: ### 新增
enabled: true ### 新增
http:
addr: :5000
headers:
X-Content-Type-Options: [nosniff]
health:
storagedriver:
enabled: true
interval: 10s
threshold: 3
/ # exit
[root@hadoop03 hadoop]# docker stop registry
registry
[root@hadoop03 hadoop]# docker start registry
registry
[root@hadoop03 hadoop]# curl -I -X DELETE http://hadoop03:5000/v2/nginx/manifests/sha256:ee89b00528ff4f02f2405e4ee221743ebc3f8e8dd0bfd5c4c20a2fa2aaa7ede3
HTTP/1.1 202 Accepted
Docker-Distribution-Api-Version: registry/2.0
X-Content-Type-Options: nosniff
Date: Thu, 27 Jan 2022 06:29:20 GMT
Content-Length: 0
更多推荐
已为社区贡献65条内容
所有评论(0)