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.

  • To delete an image from Container Registry using the Console:

    1. Open the navigation menu and click Developer Services. Under Containers & Artifacts, click Container Registry.
    2. Select the region that contains the registry.
    3. Select the compartment that contains the image.

      The Repositories and images field lists the repositories in the selected region and compartment to which you have access.

    4. Click the plus (+) button beside the name of the repository that contains the image you want to delete.

      Below the name of the repository, the images in the repository are listed, identified by the version identifier of each image.

    5. From the list, select the image that you want to delete.
    6. Click Delete image and confirm that you want to delete the image.
  • 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.