Options to Mark Docker Images as Soft Deleted
There are several ways to delete Docker images from Nexus Repository 3.
Option 1: Use the official docker API directly
You can use the docker API directly:
The trick is using this method successfully is using correct manifest hash.
Option 2: Delete Docker components using the Nexus Repository REST API plus a scheduled task
Delete the docker component via the Component API:
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
Sign in to the Nexus Repository UI and Browse 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
Review the documentation on clean-up using the Repository Cleanup Policies.
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.