docker-registry 私有倉庫映象 之 檢視與刪除
檢視私有倉庫有哪些映象
curl -XGET -u admin:admin http://192.168.91.18:5000/v2/_catalog
{"repositories":["centos","debian","mysql","nginx","php"]}
curl -s -XGET -u admin:admin http://192.168.91.18:5000/v2/_catalog | python -m json.tool
{ "repositories": [ "centos", "debian", "mysql", "nginx", "php" ] }
檢視私有倉庫映象的tag
curl -XGET -u admin:admin http://192.168.91.18:5000/v2/centos/tags/list
{"name":"centos","tags":["latest","7"]}
curl -s -XGET -u admin:admin http://192.168.91.18:5000/v2/centos/tags/list | python -m json.tool
{ "name": "centos", "tags": [ "latest", "7" ] }
刪除私有倉庫指定映象
確認是否開啟刪除功能
{"errors":[{"code":"UNSUPPORTED","message":"The operation is unsupported."}]}
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: Fri, 18 Mar 2022 04:12:22 GMT Content-Length: 78
docker ps | grep registry
3745255afa90 registry "/entrypoint.sh /etc…" About an hour ago Up About an hour 0.0.0.0:5000->5000/tcp, :::5000->5000/tcp registry
docker exec -it 3745255afa90 sh
vi /etc/docker/registry/config.yml
version: 0.1 log: fields: service: registry storage: cache: blobdescriptor: inmemory filesystem: rootdirectory: /var/lib/registry # 增加這裡的 delete 和 enabled ,注意 yaml 語法格式 # 如果有 delete ,並且 enable 為 true 表示已經開啟了刪除功能 delete: enabled: true http: addr: :5000 headers: X-Content-Type-Options: [nosniff] health: storagedriver: enabled: true interval: 10s threshold: 3
docker restart 3745255afa90
獲取指定映象的 hash 值
curl -I -XGET --header "Accept:application/vnd.docker.distribution.manifest.v2+json" \ -u admin:admin http://192.168.91.18:5000/v2/centos/manifests/latest
HTTP/1.1 200 OK Content-Length: 529 Content-Type: application/vnd.docker.distribution.manifest.v2+json Docker-Content-Digest: sha256:a1801b843b1bfaf77c501e7a6d3f709401a1e0c83863037fa3aab063a7fdb9dc Docker-Distribution-Api-Version: registry/2.0 Etag: "sha256:a1801b843b1bfaf77c501e7a6d3f709401a1e0c83863037fa3aab063a7fdb9dc" X-Content-Type-Options: nosniff Date: Fri, 18 Mar 2022 04:06:42 GMT
刪除私有倉庫中的映象
curl -I -XDELETE -u admin:admin \ http://192.168.91.18:5000/v2/centos/manifests/sha256:a1801b843b1bfaf77c501e7a6d3f709401a1e0c83863037fa3aab063a7fdb9dc
HTTP/1.1 202 Accepted Docker-Distribution-Api-Version: registry/2.0 X-Content-Type-Options: nosniff Date: Fri, 18 Mar 2022 04:24:23 GMT Content-Length: 0
curl -XGET -u admin:admin http://192.168.91.18:5000/v2/centos/tags/list
{"name":"centos","tags":["7"]}
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/70003733/viewspace-2904063/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Docker倉庫之Registry私有映象倉庫的搭建與使用Docker
- Docker搭建私有映象倉庫Docker
- 容器技術之Docker私有映象倉庫harborDocker
- 搭建私有YUM倉庫與內網映象站內網
- 企業級docker-registry原生映象倉庫高可用部署Docker
- Docker刪除倉庫中的映象問題Docker
- 容器技術之Docker私有映象倉庫docker-distributionDocker
- containerd 配置使用私有映象倉庫 harborAI
- Jenkins打Docker映象推送到私有倉庫JenkinsDocker
- Harbor-私有映象倉庫的安裝部署
- 私有 Composer 映象和倉庫的實現
- (五)github刪除倉庫Github
- git 刪除本地倉庫Git
- Docker私有倉庫之Harbor神器Docker
- 用 Docker 部署前端?你有私有映象倉庫嗎Docker前端
- Docker倉庫之Harbor企業級映象倉庫的搭建與使用Docker
- 配置kuernetes叢集pod拉取私有映象倉庫中的映象
- 私有Docker倉庫Docker
- 搭建npm私有映象倉庫,天下苦於npm build久矣NPMUI
- Kunbernetes-基於Nexus構建私有映象倉庫
- windows系統用docker構造映象上傳私有倉庫WindowsDocker
- Docker進階與實踐之四:Docker映象倉庫Docker
- Gitlab怎麼刪除倉庫Gitlab
- 用Docker搭建cnpm私有倉庫以及私有倉庫的使用DockerNPM
- 微服務探索之路03篇-docker私有倉庫Harbor搭建+Kubernetes(k8s)部署私有倉庫的映象微服務DockerK8S
- oracle db link的檢視建立與刪除Oracle
- 私有化輕量級持續整合部署方案--06-私有映象倉庫-Harbor
- Docker--harbor私有倉庫部署與管理Docker
- 已為資料庫映象啟動資料庫,必須刪除資料庫映象才能刪除該資料庫資料庫
- 配置pod拉取harbor容器映象倉庫私有映象:secret儲存賬號密碼密碼
- Docker建立私有倉庫Docker
- docker 私有倉庫搭建Docker
- docker搭建私有倉庫Docker
- Docker信任私有倉庫Docker
- indexedDB 刪除物件倉庫所有資料Index物件
- Docker 私有倉庫,pull映象報錯:server gave HTTP response to HTTPS clientDockerServerHTTPclient
- Ant Design 原始碼倉庫被刪除原始碼
- iOS 11開發教程(十六)iOS11應用檢視之刪除空白檢視iOS