Managing Repositories

Use repositories to store, share, and manage artifacts.

  • Upload related artifacts into one repository.
  • Make repositories immutable.
  • Manage access to repositories.

Required IAM Policy

To use Artifact Registry, you must be granted the required type of access in a policy (IAM)  written by an administrator, whether you're using the Console or the REST API with an SDK, CLI, or other tool.

If you perform an action and get a message that you don’t have permission or are unauthorized, cofirm with your administrator the type of access you were granted and which compartment  you are supposed to work in.

For example, to allow users in the group artifact-admins to create, update, and delete all repositories and artifacts in the compartment sales-apps:

Allow group artifact-admins to manage all-artifacts in compartment sales-apps

See Artifact Registry IAM Policies.

Creating a Repository

Create a repository for your artifacts.

Using the Console
  1. Log in to the Oracle Cloud Infrastructure Console.
  2. Open the navigation menu and click Developer Services. Under Containers & Artifacts, click Artifact Registry.
  3. Under List Scope, choose a Compartment you have permission to work in.
  4. Click Create Repository.
  5. In the Create Repository dialog box, specify details for the new repository:
    • Name: A name of your choice for the new repository.

      The name must start with a letter or underscore, followed by letters, numbers, hyphens, or underscores. Length can be 1–255 characters. Avoid entering confidential information.

      If you leave the name blank, the system automatically generates a name that you can change later.

      Auto-generated name: artifactrepository<timestamp>

      Example: artifactrepository20210423180901

    • Compartment: The compartment in which to create the repository. The default compartment is the one you selected previously, but you can select any compartment that you have permission to work in.
    • Immutable: Whether the new repository will make its artifacts immutable.

      Authorized users can use a repository's immutable artifacts, as is. However, no one can replace the immutable artifacts after they are uploaded to the repository. If anyone deletes an artifact, uploading another artifact with the deleted artifact name is not allowed. For examples, see Artifact Registry Concepts.

    • Description: Optional description.

      Avoid entering confidential information.

  6. (Optional) Add tags to the repository.

    If you have permissions to create a resource, you also have permissions to add free-form tags to that resource.

    To add a defined tag, you must have permissions to use the Tag Namespace.

    For more information about tagging, see Resource Tags. If you are not sure if you should add tags, skip this option (you can add tags later) or ask your administrator.

  7. Click Create.

After creating a repository, you can upload artifacts into the repository. See Managing Artifacts.

Using the CLI

To create a repository, use the artifacts repository resource.

Get all the commands for artifacts repository:

oci artifacts repository -h

Get help for the create command:

oci artifacts repository create -h

Find the required options:

  • --compartment-id
  • --repository-type
  • --is-immutable

Find options that are not required:

  • --display-name
  • --description
  • --freeform-tags
  • --defined-tags

Create a repository:

oci artifacts repository create --repository-type GENERIC --is-immutable <true or false> --display-name <repo-name> --compartment-id <compartment-OCID>
Note

For --repository-type, only GENERIC is allowed.

Example:

oci artifacts repository create --repository-type GENERIC --is-immutable true --display-name webb-app-repo --compartment-id ocid1.compartment.oc1..xxx...
Using the API

Use the CreateRepository operation to create a repository for your artifacts.

Listing the Repositories

List the repositories of a specific compartment.

Using the Console
  1. Log in to the Oracle Cloud Infrastructure Console.
  2. Open the navigation menu and click Developer Services. Under Containers & Artifacts, click Artifact Registry.
  3. Under List Scope, select the Compartment that you want to list its repositories.
  4. For each listed repository, view the following properties:
    • Repository Name
    • State
      • Available
      • Deleted
    • Created (creation date and time)
Using the CLI

To list all the repositories in a specific compartment, use the artifacts repository resource.

Get all the commands for artifacts repository:

oci artifacts repository -h

Get help for the list command:

oci artifacts repository list -h

Find the options to provide for the list command:

--compartment-id

Get the list of repositories in a specific compartment:

oci artifacts repository list --compartment-id <compartment-OCID>

Example:

oci artifacts repository list --compartment-id ocid1.compartment.oc1..xxx...

Add Filters

You can add filters to narrow down your results.

Example: Only list the repositories that are immutable.

oci artifacts repository list --compartment-id <compartment-OCID> is-immutable true
Using the API

Use the ListRepositories operation to list the repositories of a specified compartment.

Getting Repository Details

Get details of a specific repository.

Using the Console
  1. Log in to the Oracle Cloud Infrastructure Console.
  2. Open the navigation menu and click Developer Services. Under Containers & Artifacts, click Artifact Registry.
  3. Under List Scope, select the Compartment that contains your repository.
  4. Click the name of the repository that you want to see its details.
Using the CLI

To get a repository's details, use the artifacts repository resource.

Get all the commands for artifacts repository:

oci artifacts repository -h

Get help for the get command:

oci artifacts repository get -h

Find the options to provide for the get command:

--repository-id

Get details for a specific repository:

oci artifacts repository get --repository-id <repository-OCID>

Example:

oci artifacts repository get --repository-id ocid1.artifactrepository.oc1..xxx...

Sample output:


{
 "data":{
      "compartment-id": "ocid1.artifactrepository.oc1..xxx...",
      "defined-tags": {},
      "description": "",
      "display-name": "artifactrepository20210423180901",
      "freeform-tags": {},
      "id": "ocid1.artifactrepository.oc1..xxx...",
      "is-immutable": true,
      "lifecycle-state": "AVAILABLE",
      "repository-type": "GENERIC",
      "time-created": "2021-04-23T18:09:02.511000+00:00"
     },
     etag: "xxxxxx"
}
Using the API

Use the GetRepository operation to get the repository's details.

Updating a Repository

Update the name, description, or tags of an artifact repository.

Using the Console
  1. Log in to the Oracle Cloud Infrastructure Console.
  2. Open the navigation menu and click Developer Services. Under Containers & Artifacts, click Artifact Registry.
  3. Under List Scope, select the Compartment that contains your repository.
  4. Click the name of the repository that you want to update.
  5. Click Edit.
  6. Modify any of these properties for your repository:
    • Name (Avoid entering confidential information)
    • Description
  7. Click Save.
  8. (Optional) Click Add Tags to manage tags for this repository.

    If you have permissions to create a resource, you also have permissions to add free-form tags to that resource.

    To add a defined tag, you must have permissions to use the Tag Namespace.

    For more information about tagging, see Resource Tags. If you are not sure if you should add tags, skip this option (you can add tags later) or ask your administrator.

Using the CLI

To update a repository's name, description, or tags use the artifacts repository resource.

Get all the commands for artifacts repository:

oci artifacts repository -h

Get help for the update command:

oci artifacts repository update -h

Find the options for the update command:

  • --repository-id [required]
  • --repository-type [required]
  • --display-name (optional)
  • --description (optional)
  • --freeform-tags (optional)
  • --defined-tags (optional)

Update a repository:

oci artifacts repository update --repository-id <repository-OCID>  --repository-type GENERIC --display-name <repo-new-name> --description <new-description> --freeform-tags <key-value-pair> --defined-tags <tags-predefined-for-tenancy-namespace>

Example:

oci artifacts repository update --repository-id ocid1.artifactrepository.oc1..xxx... --repository-type GENERIC --display-name <new-repo-name> --description <new-description>
Note

You don't need to update all the optional fields. You can leave out optional fields such as --freeform-tags from your update command.
Using the API

Use the UpdateRepository operation to update a specific repository.

Moving a Repository to a Different Compartment

Move a repository from one compartment to another.

After you move a repository to a new compartment, inherent policies apply immediately and affect access to the repository through the Console. For more information, see Managing Compartments.

Using the Console
  1. Log in to the Oracle Cloud Infrastructure Console.
  2. Open the navigation menu and click Developer Services. Under Containers & Artifacts, click Artifact Registry.
  3. Under List Scope, select the Compartment that contains your repository.
  4. Click the name of the repository.
  5. Click Move Resource.
  6. Choose the destination compartment.
  7. Click Move Resource.
Using the CLI

To move a repository into another compartment, use the artifacts repository resource.

Get all the commands for artifacts repository:

oci artifacts repository -h

Get help for the change-compartment command:

oci artifacts repository change-compartment -h

Find the options to provide for the change-compartment command:

  • --repository-id
  • --compartment-id

Change the compartment of a repository:

oci artifacts repository change-compartment --repository-id <repository-OCID> --compartment-id <destination-compartment-OCID>

Example:

oci artifacts repository change-compartment --repository-id ocid1.artifactrepository.oc1..xxx... --compartment-id ocid1.compartment.oc1..xxx...
Using the API

Use the ChangeRepositoryCompartment operation to move a repository to another compartment.

Deleting a Repository

Delete an empty repository.

You can only delete empty repositories. Before you delete a repository, you must delete its artifacts. See Deleting an Artifact.

Using the Console
  1. Log in to the Oracle Cloud Infrastructure Console.
  2. Open the navigation menu and click Developer Services. Under Containers & Artifacts, click Artifact Registry.
  3. Under List Scope, select the Compartment that contains your repository.
  4. Click the name of the repository that you want to delete.
  5. Click Delete.
  6. When prompted for confirmation, click Delete.
Using the CLI

To delete a repository, use the artifacts repository resource.

Get all the commands for artifacts repository:

oci artifacts repository -h

Get help for the delete command:

oci artifacts repository delete -h

Find the options to provide for the delete command:

--repository-id

Delete a repository:

oci artifacts repository delete --repository-id <repository-OCID>

Example:

oci artifacts repository delete --repository-id ocid1.artifactrepository.oc1..xxx...
Using the API

Use the DeleteRepository operation to delete a repository.