> 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/cli-options-for-local-image-scanning.md).

# ローカルイメージスキャンの CLI オプション

イメージスキャンのCLIオプション:

```
使用法: aikido-local-scanner image-scan [options] <image>

イメージスキャンを実行します。

引数:
  image                            スキャンしたいイメージ。

オプション:
  --apikey <apikey>                スキャン結果を Aikdo に送信するための APIキー。  (env: AIKIDO_API_KEY)
  --platform <platform>            プラットフォームを設定します（たとえば amd64 システムで arm64 イメージを取得する場合など）
  --image-name <name>              スキャンするイメージの名前を指定します。これにより、<image> 引数からイメージ名を推測する既定の動作が上書きされます。イメージ名が明確でない場合に、説明的な名前を指定するために使用できます。
  --multi-arch <arch>              指定した各アーキテクチャごとに個別のスキャンを実行します（例: linux/amd64）。複数のアーキテクチャをスキャンするには、このオプションを複数回指定します。各アーキテクチャは固有のイメージ名（<image-name>-<arch>）で報告され、--output-cyclonedx-json と組み合わせると、各アーキテクチャはそれぞれ独自のファイル（<name>-<arch>.json）に書き出されます。ゲーティングモードではサポートされておらず、--platform と併用できません。
  --tag <tag>                      レポート目的でスキャンしたイメージのタグを指定します。これにより、<image> または <image-name> 引数からタグを推測する既定の動作が上書きされます。
  --debug                          コマンド出力に追加のデバッグ情報を追加します。
  --fail-on <severity>             指定した重大度以上でスキャナーをゲーティングモードで実行し、失敗させます。(選択肢: "low", "medium", "high", "critical")
  --gating-mode <mode>             スキャナーをリリースゲーティングモードまたは PR ゲーティングモードのどちらで実行するかを指定します。リリースゲーティングモードでは main ブランチをスキャンし、リリースを妨げるべき問題がないかを確認します。プルリクエストモードでは、Aikido はブランチで新たに導入された脆弱性のみを検出します。比較を機能させるには base と head のコミットを指定する必要があります。--fail-on フラグと組み合わせて使用する必要があります。(選択肢: "release", "pr", 既定値: "release")
  --sla-mode                       リリースゲーティングモードでは、SLA を超過している問題のみでゲートを失敗させます。
  --base-commit-id <commit-id>     ベースコミットIDです。Aikido が新しい検出結果かどうかを判定するために比較するコミットです。PRゲーティングモードでのみ使用されます。
  --head-commit-id <commit-id>     ヘッドコミットIDです。スキャン対象のコミットです。PRゲーティングモードでのみ使用されます。
  --gating-result-output <output>  問題を書き出す JSON ファイル（ゲーティングモードで実行している場合のみ）
  --no-fail-on-timeout             スキャン結果のポーリングがタイムアウトしてもプロセスを失敗させません（リリースゲーティングモードのみ）
  --max-polling-attempts <amount>  スキャン結果をポーリングする回数です。既定値の 20 では足りない場合は増やしてください（リリースゲーティングモードのみ）
  --linked-team-name <name>        イメージを関連付けるチーム名。
  --force-create-image-for-tag     既存のイメージのタグを更新するのではなく、そのタグで Aikido に新しいイメージを作成します。
  --scan-timeout <timeout>         各スキャンのタイムアウト（ミリ秒）。(既定値は 900000ms)。
  --output-cyclonedx-json <output> CycloneDX JSON SBOM を書き出す JSON ファイル。
  --enable-proxy                   HTTPS_PROXY 環境変数を使用してリクエストをプロキシします。
  --ca-bundle <path>               --enable-proxy を使用する際に信頼するカスタムルート CA を含む PEM ファイルへのパス。(env: AIKIDO_CA_BUNDLE)
  --linked-repository-name <name>  イメージを関連付けるリポジトリ名。
  -h, --help                       コマンドのヘルプを表示します
```

リポジトリスキャンの CLI オプションについては、こちらを参照してください [こちら](/docs/docs-ja/kdosukyan/local-code-scanning/cli-options-for-local-scanner.md).

## 一般的なユースケース <a href="#common-use-cases" id="common-use-cases"></a>

以下に、一般的なユースケースの設定例をいくつか示します。<br>

**イメージスキャンを実行したい**

```shellscript
aikido-local-scanner image-scan my-image
--apikey AIK_CI_xxx 
```

**イメージスキャンを実行し、イメージをチーム「Cloud Team」に関連付けたい**

```shellscript
aikido-local-scanner image-scan my-image
--apikey AIK_CI_xxx 
--linked-team-name "Cloud Team"
```

**イメージスキャンを実行し、イメージをチーム「Dev Team 1」と「Dev Team 2」に関連付けたい**

```shellscript
aikido-local-scanner image-scan my-image 
--apikey AIK_CI_xxx 
--linked-team-name "Dev Team 1"
--linked-team-name "Dev Team 2"
```

**イメージスキャンを実行し、SBOM を JSON ファイルに出力したい**

```shellscript
aikido-local-scanner image-scan my-image
--apikey AIK_CI_xxx 
--output-cyclonedx-json sbom.json
```

**1つのコマンドで、レジストリ上のイメージに対して複数アーキテクチャのイメージスキャンを実行したい。これにより、アーキテクチャごとの結果を持つ別々のイメージが feed に作成されます。**

```shellscript
aikido-local-scanner image-scan my-image
--apikey AIK_CI_xxx 
--multi-arch linux/amd64
--multi-arch linux/arm64
```


---

# 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/cli-options-for-local-image-scanning.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.
