Deleting an Image
Find out how to delete an image from Container Registry.
When you no longer need an image or you want to clean up the list of image versions in a repository, you can delete images from Container Registry.
Your permissions control which images you can delete (see Policies to Control Repository Access). You can delete images from repositories that you've created, and from repositories that the groups to which you belong have been granted access by IAM policies. If you belong to the Administrators group, you can delete images from any repository in the tenancy.
In addition to deleting individual images as described in this topic, you can set up image retention policies to delete images automatically based on selection criteria that you specify. See Retaining and Deleting Images Using Retention Policies.
When you delete an image, it can take up to 48 hours for the deletion to take effect and for storage to be released. If you're deleting images to release storage, you can also contact us to obtain more storage.
You can undelete an image that you've previously deleted, for up to 48 hours after you deleted it (see Undeleting (Restoring) an Image). After that time, the image is permanently removed from Container Registry.
The image you deleted no longer appears under the associated repository in the Repositories and images list.
Use the oci artifacts container image delete command and required parameters to delete an image:
oci artifacts container image delete --image-id <image-ocid> [OPTIONS]
For example:oci artifacts container image delete --image-id ocid1.containerimage.oc1.phx.0.ansh81vru1zp.aaaaaaaalqzjyks...
For a complete list of flags and variable options for CLI commands, see the Command Line Reference.
Run the DeleteContainerImage operation to delete an image.