> For the complete documentation index, see [llms.txt](https://docs.edgegap.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.edgegap.com/ru/docs/tools-and-integrations/container/external-registries/gcp-gcr.md).

# GCP GCR

### Используйте Edgegap с Google Container Registry

### Вам потребуется

* [x] Регион GCP вашего GCR
* [x] Название вашего проекта GCP
* [x] Ваш JSON-ключ для пользователя IAM

### Чтобы получить эту информацию, перейдите в консоль GCP

1. Перейдите в ваш проект
2. Перейдите в Container Registry
3. Скопируйте полное имя репозитория

### Разделить полное имя репозитория

Учитывая этот полный репозиторий: **gcr.io/project-name/example**

Ваш **Репозиторий** будет: **gcr.io**

и ваш **Образ** будет: **project-name/example**

### Сгенерируйте файл JSON-ключа

Следуйте [**Шагам GCP**](https://cloud.google.com/container-registry/docs/advanced-authentication#json-key) чтобы сгенерировать этот файл.

{% hint style="warning" %}
Пожалуйста, убедитесь, что ваш `Сервисный аккаунт Google` имеет необходимые разрешения для управления вашим реестром контейнеров
{% endhint %}

В итоге у вас будет файл, содержащий нечто подобное

```json
{
  "type": "service_account",
  "project_id": "project-name",
  "private_key_id": "12345abcdef12345",
  "private_key": "-----BEGIN PRIVATE KEY-----\n[...]\n-----END PRIVATE KEY-----\n",
  "client_email": "example@project-name.iam.gserviceaccount.com",
  "client_id": "1234567890",
  "auth_uri": "https://accounts.google.com/o/oauth2/auth",
  "token_uri": "https://oauth2.googleapis.com/token",
  "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
  "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/example%40project-name.iam.gserviceaccount.com"
}
```

### Добавьте приложение на Edgegap

#### **Пример API**

{% hint style="info" %}
Имя пользователя всегда будет **\_json\_key**
{% endhint %}

```json
{
    [...]
    "docker_repository": "gcr.io",
    "docker_image": "project-name/repository-name",
    "docker_tag": "v1",
    "private_username": "_json_key",
    "private_token": "<Содержимое файла JSON-ключа в виде JSON-строки>",
    [...]
}
```

Приватный токен будет выглядеть примерно так

```json
{
    [...]
    "private_token": "{\"type\": \"service_account\", \"project_id\": \"project-name\", \"private_key_id\": \"12345abcdef12345\", \"private_key\": \"-----BEGIN PRIVATE KEY-----\\n[...]\\n-----END PRIVATE KEY-----\\n\", \"client_email\": \"example@project-name.iam.gserviceaccount.com\", \"client_id\": \"1234567890\", \"auth_uri\": \"https://accounts.google.com/o/oauth2/auth\", \"token_uri\": \"https://oauth2.googleapis.com/token\", \"auth_provider_x509_cert_url\": \"https://www.googleapis.com/oauth2/v1/certs\", \"client_x509_cert_url\": \"https://www.googleapis.com/robot/v1/metadata/x509/example%40project-name.iam.gserviceaccount.com\"}",
    [...]
}
```

#### **Из панели управления**

На нашей панели управления **Токен приватного реестра** будет содержимым вашего **Файл JSON-ключа**

**Вы можете скопировать содержимое напрямую, не приводя его к строке**

<figure><img src="/files/26ae2326eb26c10f83d618eb6095091c20dea55b" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.edgegap.com/ru/docs/tools-and-integrations/container/external-registries/gcp-gcr.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
