Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GCR does not allow image deletion by digest when tag exists #136

Open
Luzifer opened this issue Sep 9, 2018 · 0 comments
Open

GCR does not allow image deletion by digest when tag exists #136

Luzifer opened this issue Sep 9, 2018 · 0 comments

Comments

@Luzifer
Copy link
Contributor

Luzifer commented Sep 9, 2018

Given there is an image in GCR having a manifest referenced by a digest and a tag pointing to that manifest reg rm gcr.io/project/image:tag directly tries to delete the underlying manifest instead of removing tag and afterwards digest.

This is not supported by GCR (see below for details) though this stands against the Docker API documentation. This also causes issues when multiple tags are pointing to one manifest: All of them have to be cleaned before the manifest can be removed.


$ curl -siu "$(jq -r '.auths."gcr.io".auth' ~/.docker/config.json | base64 -d)" -X DELETE https://gcr.io/v2/someproject/myimage/manifests/sha256:629783167add7484d006cd4ced67ffb91d4437e1ae0123032affbdf05955d47a
HTTP/2 400
docker-distribution-api-version: registry/2.0
content-type: application/json
date: Sun, 09 Sep 2018 12:25:04 GMT
server: Docker Registry
cache-control: private
x-xss-protection: 1; mode=block
x-frame-options: SAMEORIGIN
alt-svc: quic=":443"; ma=2592000; v="44,43,39,35"
accept-ranges: none
vary: Accept-Encoding

{"errors":[{"code":"GOOGLE_MANIFEST_DANGLING_TAG","message":"Manifest is still referenced by tag: cdd65fd"}]}

$ curl -siu "$(jq -r '.auths."gcr.io".auth' ~/.docker/config.json | base64 -d)" -X DELETE https://gcr.io/v2/someproject/myimage/manifests/cdd65fd
HTTP/2 202
docker-distribution-api-version: registry/2.0
content-type: application/json
date: Sun, 09 Sep 2018 12:26:11 GMT
server: Docker Registry
cache-control: private
x-xss-protection: 1; mode=block
x-frame-options: SAMEORIGIN
alt-svc: quic=":443"; ma=2592000; v="44,43,39,35"
accept-ranges: none
vary: Accept-Encoding

{"errors":[]}

$ curl -siu "$(jq -r '.auths."gcr.io".auth' ~/.docker/config.json | base64 -d)" -X DELETE https://gcr.io/v2/someproject/myimage/manifests/sha256:629783167add7484d006cd4ced67ffb91d4437e1ae0123032affbdf05955d47a
HTTP/2 202
docker-distribution-api-version: registry/2.0
content-type: application/json
date: Sun, 09 Sep 2018 12:26:37 GMT
server: Docker Registry
cache-control: private
x-xss-protection: 1; mode=block
x-frame-options: SAMEORIGIN
alt-svc: quic=":443"; ma=2592000; v="44,43,39,35"
accept-ranges: none
vary: Accept-Encoding

{"errors":[]}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants