> For the complete documentation index, see [llms.txt](https://help.aikido.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.aikido.dev/docs/docs-ja/kontenaimjisukyan/configuration/link-containers-to-code-repositories-via-docker-labels.md).

# Docker ラベル経由でコンテナをコードリポジトリにリンク

Docker ラベルをイメージに追加することで、コンテナイメージをコードリポジトリにリンクできます。これは、複数の異なるリポジトリからイメージをビルドし、Aikido に自動で対応付けさせたい場合に便利です。

### 対応するラベル

Aikido はリンク用に 2 つの Docker ラベルを認識します。必要なのはそのうち 1 つだけです。

* `aikido.repository`: Aikido 独自のラベル
* `org.opencontainers.image.source`: 標準の OCI ラベル

値には、そのイメージが属するコードリポジトリの完全な URL を設定してください。

両方のラベルが存在する場合、 `aikido.repository` が優先されます。

### 仕組み

Aikido がコンテナイメージをスキャンすると、イメージの OCI ラベルを確認します。対応するラベルが見つかると、そのイメージを一致するコードリポジトリに自動でリンクします。

リンクされると、コンテナの問題は Aikido フィード内の該当リポジトリに表示されます。

{% hint style="info" %}
ラベルは Dockerfile のビルド時に設定する必要があります。Aikido はそれをイメージのメタデータから直接読み取るため、イメージをプッシュした後に追加することはできません。
{% endhint %}

### リンク解除

Docker ラベル経由でイメージがリンクされると、Aikido UI からはリンク解除できません。リンクを変更するには、Dockerfile のラベル値を更新してイメージを再ビルドしてください。


---

# 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://help.aikido.dev/docs/docs-ja/kontenaimjisukyan/configuration/link-containers-to-code-repositories-via-docker-labels.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.
