> 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/local-image-scanning/release-gating-for-container-images-using-local-image-scanner.md).

# Local Image Scanner を使用したコンテナイメージのリリースゲート

Aikido Local Scanner は、プルリクエストやリリースを含む CI パイプラインのさまざまな段階でセキュリティゲートを適用できます。

リリースゲーティングでは、コンテナイメージなどのビルド成果物全体を、公開またはデプロイする前にスキャンします。従来の方法とは異なり [PR ゲーティング](/docs/docs-ja/kontenaimjisukyan/local-image-scanning/pr-gating-for-container-images-using-local-image-scanner.md)、プルリクエストで導入された変更のみをスキャンするのに対し、リリースゲーティングではビルド全体を評価します。スキャンで設定した重大度のしきい値以上の問題が見つかると、CI パイプラインは失敗し、リリースはブロックされます。

これにより、最終成果物が本番環境に届く前にセキュリティ基準を満たしていることを保証できます。

リリースゲーティングモードは、次を使用して有効にできます `--fail-on <severity>` フラグ。これは、イメージライブラリに公開する前にイメージをスキャンする際に役立ちます。リリース前に未解決の問題がないことを保証できるためです。リリースゲーティングモードで実行すると、スキャン完了後に選択した重大度以上の未解決の問題がある場合、スキャナープロセスは失敗します。

リリースゲーティングのコマンド例：

```
./aikido-local-scanner image-scan your-image-name --apikey AIK_CI_xxx --fail-on critical
```

### 例 <a href="#examples" id="examples"></a>

#### GitHub <a href="#gitlab-self-managed" id="gitlab-self-managed"></a>

GitHub 環境で Local Scanner をセットアップする方法に関する一般情報については、こちらを参照してください [この記事](https://help.aikido.dev/code-scanning/local-code-scanning/github-action-setup-for-local-code-scanning)。例 `.github/workflows/aikido-scan.yml` リリースゲーティングについては:

```yaml
name: Aikido Docker のビルドとスキャン

on:
  push:
    branches:
      - main

jobs:
  build-and-scan:
    runs-on: ubuntu-latest
    steps:
      - name: コードをチェックアウト
        uses: actions/checkout@v4

      - name: Docker Buildx を設定
        uses: docker/setup-buildx-action@v3

      - name: Docker イメージをビルド
        run: docker build -t your-local-image-name .

      - name: Aikido イメージスキャンを実行
        run: |
          docker run --rm \
            -v /var/run/docker.sock:/var/run/docker.sock \
            aikidosecurity/local-scanner \
            image-scan your-local-image-name \
            --apikey ${{ secrets.AIKIDO_API_KEY }} \
            --fail-on critical
```

#### Azure DevOps Server <a href="#gitlab-self-managed" id="gitlab-self-managed"></a>

Azure DevOps 環境で Local Scanner を設定するための一般情報については、こちらを参照してください [この記事](https://help.aikido.dev/code-scanning/local-code-scanning/github-action-setup-for-local-code-scanning)。リリースゲーティングの例:

```yaml
トリガー:
- main

pool:
  vmImage: ubuntu-latest

steps:
- script: docker build -t my-image .
  displayName: 'Docker イメージをビルド'  
- script: |
    docker run --rm -v /var/run/docker.sock:/var/run/docker.sock aikidosecurity/local-scanner image-scan my-image \
    --apikey $(AIKIDO_API_KEY) \
    --fail-on critical
  displayName: 'Aikido スキャンを実行'
```


---

# 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/local-image-scanning/release-gating-for-container-images-using-local-image-scanner.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.
