# 连接到容器注册表

> For the complete documentation index, see [llms.txt](https://www.jetbrains.com.cn/help/idea/llms.txt).

目前，IntelliJ IDEA 支持连接到 Google Artifact Registry，可用于在 Google Cloud 中存储和管理 Docker 容器镜像。

Procedure: 配置 Google Artifact Registry 连接

1. 使用 [交互式安装程序](https://cloud.google.com/sdk/docs/downloads-interactive)安装 Google Cloud CLI。

2. 使用以下命令初始化 Google Cloud CLI：

```BASH
gcloud init

```

3. 使用以下命令，通过用户凭据配置 [身份验证](https://cloud.google.com/artifact-registry/docs/docker/authentication#gcloud-helper)。

```BASH
gcloud auth login

```

4. 使用  `~/.docker/config.json` 文件和项目的区域，通过  `gcloud auth configure-docker` 命令进行配置。

请查看以下示例：

```
gcloud auth configure-docker europe-west10-docker.pkg.dev

```

5. 使用  `docker-credential-gcloud` 工具，在终端中请求存储库的凭据：

```BASH
$ echo "https://europe-west10-docker.pkg.dev" | docker-credential-gcloud get

{
"Secret": "...",
"Username": "_dcgcloud_token"
}

```

6. 按 `Ctrl+Alt+S` (Windows), `⌘ Comma` (macOS), `⌘ Comma` (IntelliJ IDEA Classic (macOS)), `⌘ Comma` (macOS System Shortcuts), `Ctrl+Alt+S` (XWin), `Ctrl+Alt+S` (GNOME), `Ctrl+Alt+S` (KDE), `Ctrl+Alt+S` (Emacs), `Ctrl+Alt+S` (Sublime Text), `⌘ Comma` (Sublime Text (macOS)), `Ctrl+Alt+S` (Visual Studio), `⌘ Comma` (Visual Studio (macOS)), `Ctrl+Alt+S` (NetBeans), `Ctrl+Alt+S` (Eclipse), `⌘ Comma` (Eclipse (macOS)) 打开设置，然后选择  `构建、执行、部署 | Docker | Docker 注册表` 。

7. 点击 ![](https://resources.jetbrains.com.cn/help/img/idea/2026.3/app.expui.general.add.svg)以添加新的 Docker 注册表，并指定以下信息：

* 注册表 ：选择 Docker V2 作为注册表类型。

* 地址 ：指定已配置项目的区域（例如， `https://europe-west10-docker.pkg.dev` ）。

* 用户名 ：指定从 `docker-credential-gcloud` 工具请求的 [用户名](#utility)。

* 密码 ：指定从 `docker-credential-gcloud` 工具请求的 [密码](#utility)。

测试连接并点击   OK  。

8. 在   Docker 注册表  节点下，您应该能够看到与已配置区域相关联的存储库中的镜像（例如，  `europe-west10` ）。

