設定檔掛載到本地的宿主機了
docker run -d -p 6000:5000 --restart=always --name registry -v `pwd`/config.yml:/etc/docker/registry/config.yml registry:2
修改過設定檔
查看倉庫中的鏡像資訊
curl -X GET http://127.0.0.1:6000/v2/_catalog
{"repositories":["myfirstimage","myfirstimage_2","myfirstimage_3"]}
取得digest值
curl -I -X GET http://127.0.0.1:6000/v2/myfirstimage/manifests/latest
HTTP/1.1 200 OK
Content-Length: 5559
Content-Type: application/vnd.docker.distribution.manifest.v1+prettyjws
Docker-Content-Digest: sha256:3a07b4e06c73b2e3924008270c7f3c3c6e3f70d4dbb814ad8bff2697123ca33c
Docker-Distribution-Api-Version: registry/2.0
Etag: "sha256:3a07b4e06c73b2e3924008270c7f3c3c6e3f70d4dbb814ad8bff2697123ca33c"
X-Content-Type-Options: nosniff
Date: Sun, 31 Jul 2016 11:09:22 GMT
刪除測驗
curl -X DELETE http://127.0.0.1:6000/v2/myfirstimage/manifests/sha256:3a07b4e06c73b2e3924008270c7f3c3c6e3f70d4dbb814ad8bff2697123ca33c
{"errors":[{"code":"MANIFEST_UNKNOWN","message":"manifest unknown"}]}
刪除失敗,這是為咋的
問題出在了取
digest
的那一步。在 registry2.3
及其以后的版本,为了防止误删除,在取digest
的時候,必須提供一個特殊的頭:否則會回傳一個錯誤的
digest
。因此,取digest
的語句應該用下面的形式:這樣取到的
digest
才是正確的。參考官方文件:https://docs.docker.com/regis...
docker run -d -p 6000:5000 --restart=always --name registry6 -v
pwd
/config.yml:/etc/docker/registry/config.yml docker.io/registry:2.5.0報錯誤:37ba01d64aec14577e9e55ea2b2bfc4487eb070fad1b1c40e76e7cbddc916e6a
/usr/bin/docker-current: Error response daemm. 247: starting container process caused "process_linux.go:359: container init caused "rootfs_linux 。 nt/ 2e35c587d0e8ff8ac8811a58b23cd3a489ff04b4eaa47b3d25fda2bd46b7646b/rootfs/etc/docker/registry/config.yml\" caused \"notno.ao/docker/recn." ?我也想修改config.yml。求指教