Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Auf dieser Seite wird beschrieben, wie Sie einzelne Dateien aus Standard- und Remote-Repositories von Artifact Registry herunterladen.
Das Repository kann ein beliebiges Artefaktformat haben.
Das Herunterladen von Dateien kann nützlich sein, wenn Sie Dateien ohne formatspezifische Tools in Ihre lokale Umgebung übertragen möchten. Beachten Sie, dass Sie sich weiterhin bei Artifact Registry authentifizieren müssen, bevor Sie Dateien herunterladen können.
Herunterladbare Dateien
Sie können jede einzelne Daten- oder Metadatendatei in Ihrem Repository herunterladen.
In einem Maven-Repository werden beispielsweise Java-Pakete als Artefakte gespeichert. Alle Dateien in einem Java-Paket, z. B. JAR- und pom.xml-Dateien, sind einzeln zum Download verfügbar.
Die Verwendung dieser Funktion wird für Artefakte, die für Downloadvorgänge stark von Client-Tools abhängen, z. B. Docker-Images, nicht empfohlen.
Bitten Sie Ihren Administrator, Ihnen die IAM-Rolle Artifact Registry Reader (roles/artifactregistry.reader) für das Repository zuzuweisen, um die Berechtigungen zu erhalten, die Sie zum Herunterladen von in einem Repository gespeicherten Dateien benötigen.
Weitere Informationen zum Zuweisen von Rollen finden Sie unter Zugriff auf Projekte, Ordner und Organisationen verwalten.
Wählen Sie in der Repository-Liste das Repository aus.
Klicken Sie auf den Namen des Pakets.
Wenn Sie herunterladbare Dateien für alle Paketversionen aufrufen möchten, klicken Sie auf den Tab Dateien.
Wenn Sie herunterladbare Dateien für eine bestimmte Version Ihres Pakets aufrufen möchten, klicken Sie auf den Versionsnamen und dann auf den Tab Dateien.
gcloud
Für alle folgenden Befehle können Sie eine maximale Anzahl von zurückzugebenden Dateien festlegen, indem Sie dem Befehl das Flag --limit hinzufügen.
So listen Sie alle Dateien im Standardprojekt, im Standard-Repository und am Standard-Speicherort auf, wenn die Standardwerte konfiguriert sind:
gcloudartifactsfileslist
Führen Sie den folgenden Befehl aus, um Dateien in einem angegebenen Projekt, Repository und Speicherort aufzulisten:
LOCATION: der regionale oder multiregionale Speicherort für das Repository.
REPOSITORY: Der Name des Repositorys, in dem das Artefakt gespeichert ist.
DESTINATION: der Pfad zum Zielordner in Ihrem lokalen Dateisystem. Der Zielordner muss bereits vorhanden sein, da der Befehl sonst fehlschlägt.
FILE: der vollständige Dateiname. Sie können diesen Wert ermitteln, indem Sie den Befehl gcloud artifacts
files list ausführen und den Wert für FILE kopieren.
LOCATION: der regionale oder multiregionale Speicherort für das Repository.
REPOSITORY: Der Name des Repositorys, in dem das Artefakt gespeichert ist.
DESTINATION: der Pfad zum Zielordner in Ihrem lokalen Dateisystem. Der Zielordner muss bereits vorhanden sein, da der Befehl sonst fehlschlägt.
FILE: Der URL-codierte Dateiname. Sie können diesen Wert ermitteln, indem Sie den Befehl gcloud
artifacts files list ausführen und den Wert für FILE kopieren. Für diesen Befehl muss sie in das URL-codierte Format konvertiert werden. Beispiel: path/to/file.jar muss als path%2Fto%2Ffile.jar eingegeben werden.
HTTP-Methode und URL:
GET https://artifactregistry.googleapis.com/download/v1/projects/PROJECT/locations/LOCATION/repositories/REPOSITORY/files/FILE:download?alt=media
Wenn Sie die Anfrage senden möchten, maximieren Sie eine der folgenden Optionen:
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-08-18 (UTC)."],[[["\u003cp\u003eThis guide details the process of downloading individual files from both standard and remote Artifact Registry repositories, regardless of the artifact format.\u003c/p\u003e\n"],["\u003cp\u003eYou can list the available files within a repository using either the Google Cloud console or the \u003ccode\u003egcloud\u003c/code\u003e command-line tool, specifying project, repository, location, package, and version details as needed.\u003c/p\u003e\n"],["\u003cp\u003eTo download a file, the \u003ccode\u003egcloud artifacts files download\u003c/code\u003e command can be used, or a direct download link through an HTTP GET request.\u003c/p\u003e\n"],["\u003cp\u003eDownloading files requires prior authentication to Artifact Registry and having the "Artifact Registry Reader" IAM role.\u003c/p\u003e\n"],["\u003cp\u003eIt is not recommended to use the download feature for artifacts that heavily depend on client tooling, like Docker images.\u003c/p\u003e\n"]]],[],null,["# Download files\n\nThis page describes how to download individual files from Artifact Registry\n[standard](/artifact-registry/docs/repositories/create-repos) repositories and [remote](/artifact-registry/docs/repositories/remote-repo) repositories.\nThe repository can be of any artifact [format](/artifact-registry/docs/supported-formats).\n\nDownloading files can be useful when you want to get files into your local\nenvironment without format-specific tooling. Note that you must still\nauthenticate to Artifact Registry before downloading files.\n\nDownloadable files\n------------------\n\nYou can download any individual data or metadata file found in your repository.\nFor example, a Maven repository will store Java packages as artifacts. Any files\nwithin a Java package, such as jar files and pom.xml files, are individually\navailable for download.\n\nUsing this feature is not recommended for artifacts that depend heavily on\nclient tooling for download operations, such as Docker images.\n\nBefore you begin\n----------------\n\n- (Optional) [Set defaults for gcloud CLI\n commands](/artifact-registry/docs/repositories/gcloud-defaults).\n\n### Required roles\n\n\nTo get the permissions that\nyou need to download files stored in a repository,\n\nask your administrator to grant you the\n\n\n[Artifact Registry Reader](/iam/docs/roles-permissions/artifactregistry#artifactregistry.reader) (`roles/artifactregistry.reader`)\nIAM role on the repository.\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\nList files\n----------\n\nYou can list files in a repository to see what is available for download. \n\n### console\n\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.\n\n3. Click the name of the package.\n\n4. To view downloadable files for all package versions, click the **Files**\n tab.\n\n5. To view downloadable files for a specific version of your package, click\n the version name, and then click the **Files** tab.\n\n### gcloud\n\n\nFor all the following commands, you can set a maximum number of files to return\nby adding the `--limit` flag to the command.\n\nTo list all files in the default project, repository, and\nlocation when the [default values are configured](/artifact-registry/docs/repositories/gcloud-defaults): \n\n gcloud artifacts files list\n\nTo list files in a specified project, repository, and location, run the command: \n\n gcloud artifacts files list \\\n --project=\u003cvar translate=\"no\"\u003ePROJECT\u003c/var\u003e \\\n --repository=\u003cvar translate=\"no\"\u003eREPOSITORY\u003c/var\u003e \\\n --location=\u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e\n\nTo list files for all versions of a specific package: \n\n gcloud artifacts files list \\\n --project=\u003cvar translate=\"no\"\u003ePROJECT\u003c/var\u003e \\\n --repository=\u003cvar translate=\"no\"\u003eREPOSITORY\u003c/var\u003e \\\n --location=\u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e \\\n --package=\u003cvar translate=\"no\"\u003ePACKAGE\u003c/var\u003e\n\nTo list files for a specific package version: \n\n gcloud artifacts files list \\\n --project=\u003cvar translate=\"no\"\u003ePROJECT\u003c/var\u003e \\\n --repository=\u003cvar translate=\"no\"\u003eREPOSITORY\u003c/var\u003e \\\n --location=\u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e \\\n --package=\u003cvar translate=\"no\"\u003ePACKAGE\u003c/var\u003e \\\n --version=\u003cvar translate=\"no\"\u003eVERSION\u003c/var\u003e\n\nReplace the following values:\n\n- \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e: the regional or multi-regional [location](/artifact-registry/docs/repo-locations) of the repository.\n- \u003cvar translate=\"no\"\u003ePROJECT\u003c/var\u003e: your Google Cloud [project ID](/resource-manager/docs/creating-managing-projects#identifying_projects). If your project ID contains a colon (`:`), see [Domain-scoped projects](/artifact-registry/docs/docker/names#domain).\n- \u003cvar translate=\"no\"\u003eREPOSITORY\u003c/var\u003e: the name of the repository where the image is stored.\n- \u003cvar translate=\"no\"\u003ePACKAGE\u003c/var\u003e: the name of the package.\n- \u003cvar translate=\"no\"\u003eVERSION\u003c/var\u003e: the version of the package.\n\nFor Docker repositories, you can list files for a specific container image tag\nby adding the `--tag` flag to the command.\n\nFor more information, see\n[gcloud artifacts files list](/sdk/gcloud/reference/artifacts/files/list).\n\nDownload files\n--------------\n\nTo download individual files from a repository, run the following command: \n\n### gcloud\n\n\nBefore using any of the command data below,\nmake the following replacements:\n\n- \u003cvar class=\"edit\" scope=\"PROJECT\" translate=\"no\"\u003ePROJECT\u003c/var\u003e: your Google Cloud [project ID](/resource-manager/docs/creating-managing-projects#identifying_projects). If your project ID contains a colon (`:`), see [Domain-scoped projects](/artifact-registry/docs/docker/names#domain).\n- \u003cvar class=\"edit\" scope=\"LOCATION\" translate=\"no\"\u003eLOCATION\u003c/var\u003e: the regional or multi-regional [location](/artifact-registry/docs/repo-locations) of the repository.\n- \u003cvar class=\"edit\" scope=\"REPOSITORY\" translate=\"no\"\u003eREPOSITORY\u003c/var\u003e: the name of the repository where the artifact is stored.\n- \u003cvar class=\"edit\" scope=\"DESTINATION\" translate=\"no\"\u003eDESTINATION\u003c/var\u003e: the path to the destination folder in your local file system. The destination folder must already exist or the command will fail.\n- \u003cvar class=\"edit\" scope=\"FILE\" translate=\"no\"\u003eFILE\u003c/var\u003e: the full filename. You can find this value by running the [`gcloud artifacts\n files list`](/sdk/gcloud/reference/artifacts/files/list) command and copying the value for `FILE`.\n\n\nExecute the\n\nfollowing\n\ncommand:\n\n#### Linux, macOS, or Cloud Shell\n\n**Note:** Ensure you have initialized the Google Cloud CLI with authentication and a project by running either [gcloud init](/sdk/gcloud/reference/init); or [gcloud auth login](/sdk/gcloud/reference/auth/login) and [gcloud config set project](/sdk/gcloud/reference/config/set). \n\n```bash\ngcloud artifacts files download \\\n --project=PROJECT \\\n --location=LOCATION \\\n --repository=REPOSITORY \\\n --destination=DESTINATION \\\n FILE\n```\n\n#### Windows (PowerShell)\n\n**Note:** Ensure you have initialized the Google Cloud CLI with authentication and a project by running either [gcloud init](/sdk/gcloud/reference/init); or [gcloud auth login](/sdk/gcloud/reference/auth/login) and [gcloud config set project](/sdk/gcloud/reference/config/set). \n\n```bash\ngcloud artifacts files download `\n --project=PROJECT `\n --location=LOCATION `\n --repository=REPOSITORY `\n --destination=DESTINATION `\n FILE\n```\n\n#### Windows (cmd.exe)\n\n**Note:** Ensure you have initialized the Google Cloud CLI with authentication and a project by running either [gcloud init](/sdk/gcloud/reference/init); or [gcloud auth login](/sdk/gcloud/reference/auth/login) and [gcloud config set project](/sdk/gcloud/reference/config/set). \n\n```bash\ngcloud artifacts files download ^\n --project=PROJECT ^\n --location=LOCATION ^\n --repository=REPOSITORY ^\n --destination=DESTINATION ^\n FILE\n```\nYou should see the download begin right away.\n\n\u003cbr /\u003e\n\n### API\n\n\nBefore using any of the request data,\nmake the following replacements:\n\n- \u003cvar class=\"edit\" scope=\"PROJECT\" translate=\"no\"\u003ePROJECT\u003c/var\u003e: your Google Cloud [project ID](/resource-manager/docs/creating-managing-projects#identifying_projects). If your project ID contains a colon (`:`), see [Domain-scoped projects](/artifact-registry/docs/docker/names#domain).\n- \u003cvar class=\"edit\" scope=\"LOCATION\" translate=\"no\"\u003eLOCATION\u003c/var\u003e: the regional or multi-regional [location](/artifact-registry/docs/repo-locations) of the repository.\n- \u003cvar class=\"edit\" scope=\"REPOSITORY\" translate=\"no\"\u003eREPOSITORY\u003c/var\u003e: the name of the repository where the artifact is stored.\n- \u003cvar class=\"edit\" scope=\"DESTINATION\" translate=\"no\"\u003eDESTINATION\u003c/var\u003e: the path to the destination folder in your local file system. The destination folder must already exist or the command will fail.\n- \u003cvar class=\"edit\" scope=\"ENC_FILE\" translate=\"no\"\u003eFILE\u003c/var\u003e: the url-encoded filename. You can find this value by running the [`gcloud\n artifacts files list`](/sdk/gcloud/reference/artifacts/files/list) command and copying the value for `FILE`. It must be converted to URL-encoded format for this command---for example, `path/to/file.jar` would need to be input as `path%2Fto%2Ffile.jar`.\n\n\nHTTP method and URL:\n\n```\nGET https://artifactregistry.googleapis.com/download/v1/projects/PROJECT/locations/LOCATION/repositories/REPOSITORY/files/FILE:download?alt=media\n```\n\nTo send your request, expand one of these options:\n\n#### curl (Linux, macOS, or Cloud Shell)\n\n\nExecute the following command:\n\n```\ncurl -X GET \\\n -H \"Authorization: Bearer $(gcloud auth print-access-token)\" \\\n --output DESTINATION \\\n \"https://artifactregistry.googleapis.com/download/v1/projects/PROJECT/locations/LOCATION/repositories/REPOSITORY/files/FILE:download?alt=media\"\n```\n\n#### PowerShell (Windows)\n\n\nExecute the following command:\n\n```\n$cred = gcloud auth print-access-token\n$headers = @{ \"Authorization\" = \"Bearer $cred\" }\n\nInvoke-WebRequest `\n -Method GET `\n -Headers $headers `\n -OutFile DESTINATION `\n -Uri \"https://artifactregistry.googleapis.com/download/v1/projects/PROJECT/locations/LOCATION/repositories/REPOSITORY/files/FILE:download?alt=media\"\n```\nYou should see the download begin right away.\n\n\u003cbr /\u003e\n\nWhat's next\n-----------\n\n- [View and list repositories](/artifact-registry/docs/repositories/list-repos)\n- [Label repositories](/artifact-registry/docs/repositories/label-repos)\n- [Tag repositories](/artifact-registry/docs/repositories/tag-repos)\n- [Delete repositories](/artifact-registry/docs/repositories/delete-repos)"]]