Delete image from container registry #14121

Closed
opened 2025-11-02 11:03:34 -06:00 by GiteaMirror · 4 comments
Owner

Originally created by @bono5150 on GitHub (Feb 10, 2025).

Feature Description

It would be nice to have an option to delete imported images by docker push command from container registry.

The description doesn't answer that question (https://docs.gitea.com/usage/packages/container)
The description of generic package registry has the deletion option, but it doesn't work for container registry (https://docs.gitea.com/usage/packages/generic). Any combination of commands don't delete the image from container registry eg:

registry url: registry.gitea.local
owner: registry

curl -k --user registry: -X DELETE https://registry.gitea.local/api/packages/registry/generic/livenessprobe/v2.8.0
package does not exist

curl -k --user registry: -X DELETE https://registry.gitea.local/api/packages/registry/livenessprobe/v2.8.0
404 page not found
curl -k --user registry: -X DELETE https://registry.gitea.local/api/registry/livenessprobe/v2.8.0
Not found.
curl -k --user registry: -X DELETE https://registry.gitea.local/registry/livenessprobe/v2.8.0
Not found.

curl -k -v --user registry: -X DELETE https://registry.gitea.local/registry/livenessprobe:v2.8.0
No response at all.

The gitea registry acts as a mirror of public registry from the internet (e.g docker.io) to speed up the deployment process tremendously.

Any ideas how to solve the issue ?

Screenshots

No response

Originally created by @bono5150 on GitHub (Feb 10, 2025). ### Feature Description It would be nice to have an option to delete imported images by docker push command from container registry. The description doesn't answer that question (https://docs.gitea.com/usage/packages/container) The description of generic package registry has the deletion option, but it doesn't work for container registry (https://docs.gitea.com/usage/packages/generic). Any combination of commands don't delete the image from container registry eg: registry url: registry.gitea.local owner: registry curl -k --user registry:<password> -X DELETE https://registry.gitea.local/api/packages/registry/generic/livenessprobe/v2.8.0 package does not exist curl -k --user registry:<password> -X DELETE https://registry.gitea.local/api/packages/registry/livenessprobe/v2.8.0 404 page not found curl -k --user registry:<password> -X DELETE https://registry.gitea.local/api/registry/livenessprobe/v2.8.0 Not found. curl -k --user registry:<password> -X DELETE https://registry.gitea.local/registry/livenessprobe/v2.8.0 Not found. curl -k -v --user registry:<password> -X DELETE https://registry.gitea.local/registry/livenessprobe:v2.8.0 No response at all. The gitea registry acts as a mirror of public registry from the internet (e.g docker.io) to speed up the deployment process tremendously. Any ideas how to solve the issue ? ### Screenshots _No response_
GiteaMirror added the type/proposalissue/needs-feedback labels 2025-11-02 11:03:34 -06:00
Author
Owner

@lunny commented on GitHub (Feb 10, 2025):

Have you added the token to your requests? Or is the token there enough permission to do that?

@lunny commented on GitHub (Feb 10, 2025): Have you added the token to your requests? Or is the token there enough permission to do that?
Author
Owner

@TheFox0x7 commented on GitHub (Feb 10, 2025):

If you have a container package you should use appropriate api endpoint for it - in your case it would be something like https://registry.gitea.local/api/v1/packages/registry/container/livenessprobe/v2.8.0
The delete endpoint you're looking for is /packages/{owner}/{type}/{name}/{version} and for containers, type should be container.

Alternatively you can use skopeo to do it, for example skopeo delete docker://registry.gitea.local/registry/livenessprobe:v2.8.0, would delete that image from your registry.

@TheFox0x7 commented on GitHub (Feb 10, 2025): If you have a container package you should use appropriate api endpoint for it - in your case it would be something like https://registry.gitea.local/api/v1/packages/registry/container/livenessprobe/v2.8.0 The delete endpoint you're looking for is `/packages/{owner}/{type}/{name}/{version}` and for containers, `type` should be `container`. Alternatively you can use [skopeo](https://github.com/containers/skopeo) to do it, for example `skopeo delete docker://registry.gitea.local/registry/livenessprobe:v2.8.0`, would delete that image from your registry.
Author
Owner

@bono5150 commented on GitHub (Feb 10, 2025):

Have you added the token to your requests? Or is the token there enough permission to do that?

The request has login and password ;)
curl -k --user registry:<- here is the password (it is not visible on this page because it is in angle brackets)
The authentication and authorization process works pretty well.

@bono5150 commented on GitHub (Feb 10, 2025): > Have you added the token to your requests? Or is the token there enough permission to do that? The request has login and password ;) curl -k --user registry:<- here is the password (it is not visible on this page because it is in angle brackets) The authentication and authorization process works pretty well.
Author
Owner

@bono5150 commented on GitHub (Feb 10, 2025):

If you have a container package you should use appropriate api endpoint for it - in your case it would be something like https://registry.gitea.local/api/v1/packages/registry/container/livenessprobe/v2.8.0 The delete endpoint you're looking for is /packages/{owner}/{type}/{name}/{version} and for containers, type should be container.

Alternatively you can use skopeo to do it, for example skopeo delete docker://registry.gitea.local/registry/livenessprobe:v2.8.0, would delete that image from your registry.

Thank you very much. It works great :)
I really appreciate your help.

@bono5150 commented on GitHub (Feb 10, 2025): > If you have a container package you should use appropriate api endpoint for it - in your case it would be something like https://registry.gitea.local/api/v1/packages/registry/container/livenessprobe/v2.8.0 The delete endpoint you're looking for is `/packages/{owner}/{type}/{name}/{version}` and for containers, `type` should be `container`. > > Alternatively you can use [skopeo](https://github.com/containers/skopeo) to do it, for example `skopeo delete docker://registry.gitea.local/registry/livenessprobe:v2.8.0`, would delete that image from your registry. Thank you very much. It works great :) I really appreciate your help.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#14121