How to delete docker images from Nexus Repository Manager

Options to Mark Docker Images as Soft Deleted

There are several ways to delete Docker images from Nexus Repository Manager.

Option 1: Use the official docker API directly

You can use the docker API directly:

https://docs.docker.com/registry/spec/api/#deleting-an-image

The trick is using this method successfully is using correct manifest hash.

Option 2: Delete Docker components using the Nexus REST API plus a scheduled task

Delete the docker component via the Component API:

DELETE <nexusURL>/service/rest/beta/components/{COMPONENT_ID}

You can obtain the component ID by searching for the docker image via its coordinates (name, version, repo) using the Search API.

Option 3: Delete using UI Browse

Signin to the Nexus UI and Browse to the Docker manifests you wish to delete. Use the Delete button exposed after a Component is selected.

Option 4: Clean up Docker Images by Age

Check the Fix Version of issue NEXUS-11435 to learn about when this feature is available.

Required Final Steps to Completely Delete Docker Assets From Disk

1. Configure and run the 'Docker - Delete unused manifests and images' task to delete orphaned docker layers.

Due to how docker works, the options listed in this article to delete an image manifest will not delete any layers associated with the Docker image, so this task is needed to remove any layers that have been orphaned by the manifest delete.

2. Configure and run the 'Admin - Compact blob store' task to reclaim disk space from the blob store for any assets already marked soft-deleted, including the Docker related ones created using options in this article.

Have more questions? Submit a request

0 Comments

Article is closed for comments.
Powered by Zendesk