Moving a Repository Between Compartments

Find out how to move a repository in Container Registry from one compartment to another.

When you create a new repository in Container Registry, you specify the compartment in which to create it. Having created the repository in one compartment, you can subsequently move it to a different compartment. For example, to change the users who are authorized to use the repository, or to change how billing for a repository is charged.

Only users with appropriate permissions can access the repository in the compartment that you move it to.

Your permissions control which repositories you can move, and the compartments that you can move them to (see Policies to Control Repository Access). You can move repositories that you've created (and repositories that the groups to which you belong have been granted access by IAM policies) to any compartment to which you have access. If you belong to the Administrators group, you can move any repository in the tenancy to any compartment.

  • To move a repository in Container Registry from one compartment to another 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 repository.
    3. Select the compartment that contains the repository.

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

    4. From the list, select the repository that you want to move.
    5. Click Move compartment.
    6. Select the compartment to which you want to move the repository.
    7. Click Submit to move the repository.

      The repository is moved to the compartment you selected.

      Only users with appropriate permissions can now access the repository in the compartment that you've moved it to.

  • Use the oci artifacts container repository change-compartment command and required parameters to move repositories between compartments:

    oci artifacts container repository change-compartment --compartment-id <compartment_ocid_new> --repository-id <repository_ocid> [OPTIONS]
    For example:
    oci artifacts container repository change-compartment --compartment-id ocid1.compartment.oc1..aaaaaaaaswegb83o... --repository-id ocid1.containerrepo.oc1.us-phoenix-1.0.ansh81vru1zp.aaaaaaaatxfd94p...

    For a complete list of flags and variable options for CLI commands, see the Command Line Reference.

  • Run the ChangeContainerRepositoryCompartment operation to move a repository to a different compartment.