We accidentally pushed an image to a repository and want to remove the image from the docker hub registry. We’ve removed the tags from the erroneous image digest, but the image still exists in the repo and can be pulled with docker pull some/repository@digest
We don’t want to delete the repository entirely so that people pulling from the image don’t have any issues.
We’ve tried going through the api with these steps based on the api docs https://docs.docker.com/registry/spec/api/#deleting-an-image
:
Auth:
curl -v -u myuser:mypassword "https://auth.docker.io/token?service=registry.docker.io&scope=repository:some/repository:delete,pull&offline_token=1&client_id=shell"
Delete:
curl -v -H "Authorization: Bearer <token>" -X DELETE https://registry.hub.docker.com/v2/some/repository/manifests/<some-image-digest>
which returns
405 Method Not Allowed
{"errors":[{"code":"UNSUPPORTED","message":"The operation is unsupported."}]}
These docs say that this error could be attributed to delete
being disabled (https://docs.docker.com/registry/configuration/#delete). But we’re not sure how the docker hub registry is configured. Is this the case? Or are we doing something wrong?
Thanks!