You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am building a opensource project with CI/CD.
Every commit is builded and pushed to docker hub with the short commit number as their tag.
I wanted to find a way to cleanup old commit builds but keep a few (i.e. last 15 days and at least 3).
i.e.
a little tool that would take a few argument:
repository to run against
regex match for tags
days to keep
minimum number of tags to keep
I looked at registry api against registry-1.docker.io. And i am able to list tags with details without any issues.
Delete manifests is apparently supported there.
doing a delete on https://registry-1.docker.io/v2/{repo}/maniftests/{digest} responds with:
{"errors":[{"code":"UNSUPPORTED","message":"The operation is unsupported."}]}
From my reading of it, it seems that delete has not been disabled on the backend registry.
Delete has been disabled in hub registry. If needed please delete tag from Hub API DELETE hub.docker.com/v2/repositories/{repo}/tags/{tag}. You will authenticate though.
Both api's apparently are protected by the same authenication/authorization mechanism but a specific api is needed for docker hub?
For people making use of registries it sounds to me that generic tools and api looks better.
Could you elaborate on the reason not to trust delete at the registry api level?
Disabling delete was probably done before me but I am guessing it is because that API was getting implemented at that time. Blocking deletes is also safer as user have called it by mistake. Deleting from Hub allows us to fine tune the delete.
Note that although you are free to call registry APIs directly we do not guarantee that every registry API will be implemented. Our primary focus is to ensure it works seamlessly with Docker CLI.
Reacted by Jon Johnson, Phil, David Halls, Tim Downey, Matt Royal, yorqat, tonsV2, Nicolas Trésegnie and Staffan Forsell
When I saw that registry still contains the old tags, I tried to delete them with the manifest references but encountered the same issue than @cblomart .
Is this something expected?
My main point is that when using flux with image update automation, it founds tags that are still listed by the Docker Registry but not available from the DockerHub.
Activity
manishtomar commentedon Mar 6, 2019
Delete has been disabled in hub registry. If needed please delete tag from Hub API
DELETE hub.docker.com/v2/repositories/{repo}/tags/{tag}. You will authenticate though.manishtomar commentedon Mar 6, 2019
Closing as non-issue.
cblomart commentedon Mar 7, 2019
Both api's apparently are protected by the same authenication/authorization mechanism but a specific api is needed for docker hub?
For people making use of registries it sounds to me that generic tools and api looks better.
Could you elaborate on the reason not to trust delete at the registry api level?
manishtomar commentedon Mar 7, 2019
Disabling delete was probably done before me but I am guessing it is because that API was getting implemented at that time. Blocking deletes is also safer as user have called it by mistake. Deleting from Hub allows us to fine tune the delete.
Note that although you are free to call registry APIs directly we do not guarantee that every registry API will be implemented. Our primary focus is to ensure it works seamlessly with Docker CLI.
cblomart commentedon Mar 8, 2019
If operations needs to go trough:
hub.docker.com/v2/repositories/{repo}/tags/{tag}
A documentations of the API would be realy nice!
I am currently trying to get all tags via this api and the pagination does give me a headache.
cblomart commentedon Mar 9, 2019
Btw the url that seem to work is not
hub.docker.com/v2/repositories/{repo}/tags/{tag}butcloud.docker.com/v2/repositories/{repo}/tags/{tag}/ViBiOh commentedon Jan 30, 2021
I found this issue when trying to delete tags from the Docker registry instead of DockerHub.
If I curl the DockerHub API, I only have
latesttagBut if I do the same on the registry directly, I got much more answer
I was used to clean my repositories by using that query.
When I saw that registry still contains the old tags, I tried to delete them with the manifest references but encountered the same issue than @cblomart .
Is this something expected?
My main point is that when using flux with image update automation, it founds tags that are still listed by the Docker Registry but not available from the DockerHub.