Update repository settings

You can update the following repository settings:

  • Repository description.

  • Remote repository upstream authentication details.

  • Immutable image tags for Docker repositories. If you enable this setting, an image tag always points to the same image digest, including the default latest tag.

    To learn more about image tags, image digests, and immutable image tags, see Container image versions.

  • Repository labels.

Required roles

To get the permissions that you need to update repository settings, ask your administrator to grant you the Artifact Registry Administrator (roles/artifactregistry.admin) IAM role on the Google Cloud project. For more information about granting roles, see Manage access.

You might also be able to get the required permissions through custom roles or other predefined roles.

Update settings

You can update settings using Google Cloud console or Google Cloud CLI.

Console

  1. Open the Repositories page in the Google Cloud console.

    Open the Repositories page

  2. In the repository list, select the repository and click Edit Repository.

  3. Edit the settings that you want to change:

    • Change the repository description.
    • Update your remote repository upstream authentication details.
    • Enable or disable immutable image tags in the Immutable image tags section. If you enable this setting, the following actions are not permitted:

      • Delete a tagged image.
      • Remove a tag from an image.
      • Push an image with a tag that is already used by another version of the image in the repository.
      • Add, remove, or update labels.
  4. Click Save.

gcloud

To edit the repository description, run the following command:

gcloud artifacts repositories update REPOSITORY \
    --project=PROJECT-ID \
    --location=LOCATION \
    --description="DESCRIPTION"

To update your remote repository upstream authentication details, run the following command:

gcloud artifacts repositories update REPOSITORY \
    --project=PROJECT_ID \
    --location=LOCATION \
    --remote-username=USERNAME \
    --remote-password-secret-version=projects/PROJECT_ID/secrets/SECRET_ID/versions/SECRET_VERSION

To edit the image tag mutability, run one of the following commands:

To set image tags to immutable:

gcloud artifacts repositories update REPOSITORY \
    --project=PROJECT-ID \
    --location=LOCATION \
    --immutable-tags

To set image tags to mutable:

gcloud artifacts repositories update REPOSITORY \
    --project=PROJECT-ID \
    --location=LOCATION \
    --no-immutable-tags

To update labels, run the following command:

gcloud artifacts repositories update REPOSITORY \
    --project=PROJECT-ID \
    --location=LOCATION \
    --update-labels="KEY=VALUE,..."

Replace the following values:

  • REPOSITORY with the name of the repository. If you configured a default repository, you can omit this flag to use the default.
  • PROJECT-ID with the Google Cloud project ID. If this flag is omitted, the current or default project is used.
  • LOCATION with the regional or multi-regional location. Use this flag to view repositories in a specific location. If you configured a default location, you can omit this flag to use the default.
  • DESCRIPTION with a description for the repository.
  • USERNAME with your upstream repository username.
  • SECRET_ID with the name of your secret.
  • SECRET_VERSION with the secret version you want to use.
  • TAG-SETTING indicates how tags are associated with versions of images.
  • --no-immutable-tags: the image version that tag points to can change. Deleting images, removing tags, and changing the version of an image that a tag points to are permitted.
  • --immutable-tags: in the repository, a tag always points to same version of an image. The following actions are not permitted:
    • Delete a tagged image.
    • Remove a tag from an image.
    • Push an image with a tag that is already used by another version of the image in the repository.
  • KEY=VALUE,... with a list of comma-separated labels specified as key-value pairs. For example: team=team-1,product=example_product,stage=development. For more information about working with labels, see Label repositories.