# 连接到容器注册表

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

目前，CLion 支持连接到 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. 使用  `gcloud auth configure-docker` 命令和项目的区域配置  `~/.docker/config.json` 文件。

请查看以下示例：

```
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)), `⌘ Comma` (Xcode), `Ctrl+Alt+S` (Visual Studio), `⌘ Comma` (Visual Studio (macOS)), `Ctrl+Alt+S` (ReSharper), `⌘ Comma` (ReSharper (macOS)), `Ctrl+Alt+S` (QtCreator), `⌘ Comma` (QtCreator (macOS)), `Ctrl+Alt+S` (NetBeans), `Ctrl+Alt+S` (Eclipse), `⌘ Comma` (Eclipse (macOS)) 打开设置，然后选择  `构建、执行、部署 | Docker | Docker 注册表` 。

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

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

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

* 用户名 ：指定 [用户名](#utility)，该用户名由 `docker-credential-gcloud` 实用程序请求。

* 密码 ：指定 [密码](#utility)，该密码由 `docker-credential-gcloud` 实用程序请求

测试连接并点击   确定  。

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

