Atualize as definições do repositório
Pode atualizar as seguintes definições do repositório:
Funções necessárias
Para receber as autorizações de que
precisa para atualizar as definições do repositório,
peça ao seu administrador para lhe conceder a função do IAM
Administrador do Artifact Registry (roles/artifactregistry.admin
) no Trusted Cloud projeto.
Para mais informações sobre a atribuição de funções, consulte o artigo Faça a gestão do acesso a projetos, pastas e organizações.
Também pode conseguir as autorizações necessárias através de funções
personalizadas ou outras funções
predefinidas.
Atualize as definições
Pode atualizar as definições através da Trusted Cloud consola ou da CLI Google Cloud.
Consola
Abra a página Repositórios na Trusted Cloud consola.
Abra a página Repositórios
Na lista de repositórios, selecione o repositório e clique em Editar repositório.
Edite as definições que quer alterar:
- Altere a descrição do repositório.
- Ative ou desative as etiquetas de imagens imutáveis na secção Etiquetas de imagens imutáveis. Se ativar esta definição, as seguintes ações não são permitidas:
- Elimine uma imagem etiquetada.
- Remova uma etiqueta de uma imagem.
- Enviar uma imagem com uma etiqueta que já é usada por outra versão da imagem no repositório.
- Adicione, remova ou atualize etiquetas.
Clique em Guardar.
gcloud
Para editar a descrição do repositório, execute o seguinte comando:
gcloud artifacts repositories update REPOSITORY \
--project=PROJECT-ID \
--location=LOCATION \
--description="DESCRIPTION"
Para editar a capacidade de alteração da etiqueta de imagem, execute um dos seguintes comandos:
Para definir etiquetas de imagens como imutáveis:
gcloud artifacts repositories update REPOSITORY \
--project=PROJECT-ID \
--location=LOCATION \
--immutable-tags
Para definir etiquetas de imagens como mutáveis:
gcloud artifacts repositories update REPOSITORY \
--project=PROJECT-ID \
--location=LOCATION \
--no-immutable-tags
Para atualizar etiquetas, execute o seguinte comando:
gcloud artifacts repositories update REPOSITORY \
--project=PROJECT-ID \
--location=LOCATION \
--update-labels="KEY=VALUE,..."
Substitua os seguintes valores:
REPOSITORY
é o nome do repositório. Se configurou um repositório predefinido, pode omitir esta flag para usar o predefinido.
PROJECT-ID
é o Trusted Cloud by S3NS ID do projeto. Se esta flag for omitida, é usado o projeto atual ou predefinido.
-
LOCATION
é a localização regional do repositório.
Use esta flag para ver repositórios numa localização específica. Se configurou uma localização predefinida, pode omitir esta flag para usar a predefinição.
DESCRIPTION
é uma descrição do repositório.
SECRET_ID
é o nome do seu segredo.
SECRET_VERSION
é a versão do segredo que quer usar.
- Os dois indicadores de definição de etiquetas,
--no-immutable-tags
ou
--immutable-tags
, indicam como as etiquetas estão associadas às versões das imagens.
--no-immutable-tags
: a versão da imagem para a qual a etiqueta aponta pode mudar. A eliminação de imagens, a remoção de etiquetas e a alteração da versão de uma imagem para a qual uma etiqueta aponta são permitidas.
--immutable-tags
: no repositório, uma etiqueta aponta sempre para a mesma versão de uma imagem. As seguintes ações não são permitidas:
- Elimine uma imagem etiquetada.
- Remova uma etiqueta de uma imagem.
- Enviar uma imagem com uma etiqueta que já é usada por outra versão da imagem no repositório.
KEY=VALUE...
é uma lista de etiquetas separadas por vírgulas especificadas como pares de chave-valor. Por exemplo: team=team-1,product=example_product,stage=development
. Para mais informações sobre como trabalhar com etiquetas, consulte o artigo Etiquete repositórios.
Exceto em caso de indicação contrária, o conteúdo desta página é licenciado de acordo com a Licença de atribuição 4.0 do Creative Commons, e as amostras de código são licenciadas de acordo com a Licença Apache 2.0. Para mais detalhes, consulte as políticas do site do Google Developers. Java é uma marca registrada da Oracle e/ou afiliadas.
Última atualização 2025-08-21 UTC.
[[["Fácil de entender","easyToUnderstand","thumb-up"],["Meu problema foi resolvido","solvedMyProblem","thumb-up"],["Outro","otherUp","thumb-up"]],[["Não contém as informações de que eu preciso","missingTheInformationINeed","thumb-down"],["Muito complicado / etapas demais","tooComplicatedTooManySteps","thumb-down"],["Desatualizado","outOfDate","thumb-down"],["Problema na tradução","translationIssue","thumb-down"],["Problema com as amostras / o código","samplesCodeIssue","thumb-down"],["Outro","otherDown","thumb-down"]],["Última atualização 2025-08-21 UTC."],[[["\u003cp\u003eRepository settings like description, upstream authentication, image tag mutability, labels, and vulnerability scanning can be updated.\u003c/p\u003e\n"],["\u003cp\u003eUpdating repository settings requires the Artifact Registry Administrator role or equivalent permissions through custom or predefined roles.\u003c/p\u003e\n"],["\u003cp\u003eImmutable image tags can be enabled to ensure a tag always points to the same image digest, preventing actions like deleting or retagging images.\u003c/p\u003e\n"],["\u003cp\u003eRepository settings can be updated via the Google Cloud console or the Google Cloud CLI using specific commands.\u003c/p\u003e\n"],["\u003cp\u003eVulnerability scanning can be enabled or disabled for a repository to monitor potential security weaknesses in the stored images.\u003c/p\u003e\n"]]],[],null,["# Update repository settings\n\nYou can update the following repository settings:\n\n- Repository description.\n- Remote repository upstream authentication details.\n- 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.\n\n To learn more about image tags, image digests, and immutable image tags, see\n [Container image versions](/artifact-registry/docs/docker/names#versions).\n- Repository [labels](/artifact-registry/docs/repositories/label-repos).\n- Vulnerability [scanning settings](/artifact-analysis/docs/enable-automatic-scanning#disable-repo).\n\n### Required roles\n\n\nTo get the permissions that\nyou need to update repository settings,\n\nask your administrator to grant you the\n\n\n[Artifact Registry Administrator](/iam/docs/roles-permissions/artifactregistry#artifactregistry.admin) (`roles/artifactregistry.admin`)\nIAM role on the Google Cloud project.\n\n\nFor more information about granting roles, see [Manage access to projects, folders, and organizations](/iam/docs/granting-changing-revoking-access).\n\n\nYou might also be able to get\nthe required permissions through [custom\nroles](/iam/docs/creating-custom-roles) or other [predefined\nroles](/iam/docs/roles-overview#predefined).\n\nUpdate settings\n---------------\n\nYou can update settings using Google Cloud console or Google Cloud CLI. \n\n### Console\n\n1. Open the **Repositories** page in the Google Cloud console.\n\n [Open the Repositories page](https://console.cloud.google.com/artifacts)\n2. In the repository list, select the repository and click **Edit Repository**.\n\n3. Edit the settings that you want to change:\n\n - Change the repository description.\n - Update your remote repository upstream authentication details.\n - **Enable** or **disable** immutable image tags in the **Immutable image tags** section. If you enable this setting, the following actions are not permitted:\n - Delete a tagged image.\n - Remove a tag from an image.\n - Push an image with a tag that is already used by another version of the image in the repository.\n - Add, remove, or update labels.\n - **Enable** or **disable** vulnerability scanning.\n4. Click **Save**.\n\n### gcloud\n\nTo edit the repository description, run the following command: \n\n gcloud artifacts repositories update \u003cvar translate=\"no\"\u003eREPOSITORY\u003c/var\u003e \\\n --project=\u003cvar translate=\"no\"\u003ePROJECT-ID\u003c/var\u003e \\\n --location=\u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e \\\n --description=\"\u003cvar translate=\"no\"\u003eDESCRIPTION\u003c/var\u003e\"\n\n\nTo update your remote repository upstream authentication details, run the\nfollowing command: \n\n gcloud artifacts repositories update \u003cvar translate=\"no\"\u003eREPOSITORY\u003c/var\u003e \\\n --project=\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e \\\n --location=\u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e \\\n --remote-username=\u003cvar translate=\"no\"\u003eUSERNAME\u003c/var\u003e \\\n --remote-password-secret-version=projects/\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e/secrets/\u003cvar translate=\"no\"\u003eSECRET_ID\u003c/var\u003e/versions/\u003cvar translate=\"no\"\u003eSECRET_VERSION\u003c/var\u003e\n\nTo edit the image tag mutability, run one of the following commands:\n\nTo set image tags to immutable: \n\n gcloud artifacts repositories update \u003cvar translate=\"no\"\u003eREPOSITORY\u003c/var\u003e \\\n --project=\u003cvar translate=\"no\"\u003ePROJECT-ID\u003c/var\u003e \\\n --location=\u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e \\\n --immutable-tags\n\nTo set image tags to mutable: \n\n gcloud artifacts repositories update \u003cvar translate=\"no\"\u003eREPOSITORY\u003c/var\u003e \\\n --project=\u003cvar translate=\"no\"\u003ePROJECT-ID\u003c/var\u003e \\\n --location=\u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e \\\n --no-immutable-tags\n\nTo update labels, run the following command: \n\n gcloud artifacts repositories update \u003cvar translate=\"no\"\u003eREPOSITORY\u003c/var\u003e \\\n --project=\u003cvar translate=\"no\"\u003ePROJECT-ID\u003c/var\u003e \\\n --location=\u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e \\\n --update-labels=\"\u003cvar translate=\"no\"\u003eKEY\u003c/var\u003e=\u003cvar translate=\"no\"\u003eVALUE\u003c/var\u003e,...\"\n\n\nTo edit the vulnerability scanning settings, run one of the following commands:\n\nTo disable scanning on the repository: \n\n gcloud artifacts repositories update \u003cvar translate=\"no\"\u003eREPOSITORY\u003c/var\u003e \\\n --project=\u003cvar translate=\"no\"\u003ePROJECT-ID\u003c/var\u003e \\\n --location=\u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e \\\n --disable-vulnerability-scanning\n\nTo allow scanning on the repository: \n\n gcloud artifacts repositories update \u003cvar translate=\"no\"\u003eREPOSITORY\u003c/var\u003e \\\n --project=\u003cvar translate=\"no\"\u003ePROJECT-ID\u003c/var\u003e \\\n --location=\u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e \\\n --allow-vulnerability-scanning\n\nReplace the following values:\n\n- \u003cvar translate=\"no\"\u003e\u003ccode translate=\"no\" dir=\"ltr\"\u003eREPOSITORY\u003c/code\u003e\u003c/var\u003e is the name of the repository. If you configured a [default](/artifact-registry/docs/gcloud-defaults) repository, you can omit this flag to use the default.\n- \u003cvar translate=\"no\"\u003e\u003ccode translate=\"no\" dir=\"ltr\"\u003ePROJECT-ID\u003c/code\u003e\u003c/var\u003e is the Google Cloud project ID. If this flag is omitted, the current or default project is used.\n- \u003cvar translate=\"no\"\u003e\u003ccode translate=\"no\" dir=\"ltr\"\u003eLOCATION\u003c/code\u003e\u003c/var\u003e is the regional or multi-regional [location](/artifact-registry/docs/repo-locations) of the repository. Use this flag to view repositories in a specific location. If you configured a [default](/artifact-registry/docs/gcloud-defaults) location, you can omit this flag to use the default.\n- \u003cvar translate=\"no\"\u003e\u003ccode translate=\"no\" dir=\"ltr\"\u003eDESCRIPTION\u003c/code\u003e\u003c/var\u003e is a description for the repository.\n- \u003cvar translate=\"no\"\u003e\u003ccode translate=\"no\" dir=\"ltr\"\u003eUSERNAME\u003c/code\u003e\u003c/var\u003e is your upstream repository username.\n- \u003cvar translate=\"no\"\u003e\u003ccode translate=\"no\" dir=\"ltr\"\u003eSECRET_ID\u003c/code\u003e\u003c/var\u003e is the name of your secret.\n- \u003cvar translate=\"no\"\u003e\u003ccode translate=\"no\" dir=\"ltr\"\u003eSECRET_VERSION\u003c/code\u003e\u003c/var\u003e is the secret version you want to use.\n- The two tag setting flags, `--no-immutable-tags` or `--immutable-tags`, indicate how tags are associated with versions of images.\n - `--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.\n - `--immutable-tags`: in the repository, a tag always points to same version of an image. The following actions are not permitted:\n - Delete a tagged image.\n - Remove a tag from an image.\n - Push an image with a tag that is already used by another version of the image in the repository.\n- \u003cvar translate=\"no\"\u003eKEY\u003c/var\u003e`=`\u003cvar translate=\"no\"\u003eVALUE\u003c/var\u003e`...` is 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](/artifact-registry/docs/repositories/label-repos).\n\n\u003cbr /\u003e\n\nWhat's next\n-----------\n\n- Learn to [restrict artifact downloads with download rules](/artifact-registry/docs/restrict-artifact-downloads)."]]