Skip to content
KitploitKITPLOIT
ツールブログ
提出
ツールブログ
提出

ハッキング、侵入テスト、サイバーセキュリティツールをあなたのセキュリティアーセナルに!

Kitploitはハッキング、サイバーセキュリティ、ペネトレーションテストのツールディレクトリです。最新のプロジェクトアップデートを見つけて、脆弱性の発見、システム分析、テストの自動化、セキュリティの強化を行いましょう。

··フィード·お問い合わせ·プライバシー·© 2026 Kitploit

ツールディレクトリ

カテゴリ

すべてのカテゴリを見る
Loading categories
dive — Dockerイメージの各レイヤーを探索するためのツール | Kitploit
ツール/GitHubGitHub/wagoodman/dive
汎用ユーティリティコンテナセキュリティ
GitHubwagoodman/dive

dive

Dockerイメージの各レイヤーを探索するためのツール

リポジトリを見る
54.4k2.0k1年前Kitploit レビュー済み

人気

すべて見る →

コミュニティで最も使われているツールを見つけましょう。

すべてのツールを探索

ツールコレクションを閲覧

すべてのツールを見る →
共有

dive

GitHub release Validations Go Report Card License: MIT Donate

Dockerイメージ、レイヤーコンテンツを探索し、Docker/OCIイメージのサイズを縮小する方法を見つけるためのツール。

Image

Dockerイメージを分析するには、イメージタグ/ID/ダイジェストを指定してdiveを実行するだけです:

root@kitploit:~
dive <your-image-tag>

または、Dockerで直接ダイブすることもできます:

root@kitploit:~
alias dive="docker run -ti --rm  -v /var/run/docker.sock:/var/run/docker.sock docker.io/wagoodman/dive"
dive <your-image-tag>

# for example
dive nginx:latest

または、イメージをビルドしてからすぐに分析に飛び込みたい場合:

root@kitploit:~
dive build -t <some-tag> .

macOSでのビルド(Dockerコンテナエンジンのみサポート):

root@kitploit:~
docker run --rm -it \
      -v /var/run/docker.sock:/var/run/docker.sock \
      -v  "$(pwd)":"$(pwd)" \
      -w "$(pwd)" \
      -v "$HOME/.dive.yaml":"$HOME/.dive.yaml" \
      docker.io/wagoodman/dive:latest build -t <some-tag> .

さらに、CIパイプラインでこれを実行して、無駄なスペースを最小限に抑えていることを確認できます(UIはスキップされます):

root@kitploit:~
CI=true dive <your-image>

Image

これはベータ品質です! 新しい機能が必要な場合やバグを見つけた場合は、遠慮なく問題を送信してください :)

基本機能

レイヤーごとに分割されたDockerイメージの内容を表示

左側でレイヤーを選択すると、右側にそのレイヤーとそれ以前のすべてのレイヤーの内容が結合されて表示されます。また、矢印キーでファイルツリーを完全に探索できます。

各レイヤーで変更された内容を示す

変更、修正、追加、または削除されたファイルがファイルツリーに表示されます。これは特定のレイヤーの変更、またはこのレイヤーまでの集約された変更を表示するように調整できます。

「イメージ効率」の推定

左下のペインには、基本的なレイヤー情報と、イメージにどれだけの無駄なスペースが含まれているかを推測する実験的なメトリックが表示されます。これは、レイヤー間でのファイルの重複、レイヤー間でのファイルの移動、またはファイルの完全な削除が行われていないことによる可能性があります。パーセンテージの「スコア」と無駄なファイルスペースの合計の両方が提供されます。

迅速なビルド/分析サイクル

1つのコマンドでDockerイメージをビルドし、即座に分析できます: dive build -t some-tag .

docker build コマンドを同じ dive build コマンドに置き換えるだけです。

CI統合

イメージを分析し、イメージ効率と無駄なスペースに基づいて合格/不合格の結果を取得します。有効なdiveコマンドを呼び出すときに環境で CI=true を設定するだけです。

複数のイメージソースとコンテナエンジンをサポート

--source オプションを使用すると、コンテナイメージの取得元を選択できます:

root@kitploit:~
dive <your-image> --source <source>

または

root@kitploit:~
dive <source>://<your-image>

有効な source オプションは次のとおりです:

  • docker: Dockerエンジン(デフォルトオプション)
  • docker-archive: ディスク上のDocker Tarアーカイブ
  • podman: Podmanエンジン(Linuxのみ)

インストール

Ubuntu/Debian

debの使用:

root@kitploit:~
DIVE_VERSION=$(curl -sL "https://api.github.com/repos/wagoodman/dive/releases/latest" | grep '"tag_name":' | sed -E 's/.*"v([^"]+)".*/\1/')
curl -fOL "https://github.com/wagoodman/dive/releases/download/v${DIVE_VERSION}/dive_${DIVE_VERSION}_linux_amd64.deb"
sudo apt install ./dive_${DIVE_VERSION}_linux_amd64.deb

Snapの使用:

root@kitploit:~
sudo snap install docker
sudo snap install dive
sudo snap connect dive:docker-executables docker:docker-executables
sudo snap connect dive:docker-daemon docker:docker-daemon

[!CAUTION] Snap方式は、apt-get でDockerをインストールした場合、既存のDockerデーモンが壊れる可能性があるため推奨されません。

関連リンク: https://github.com/wagoodman/dive/issues/546

RHEL/Centos

root@kitploit:~
DIVE_VERSION=$(curl -sL "https://api.github.com/repos/wagoodman/dive/releases/latest" | grep '"tag_name":' | sed -E 's/.*"v([^"]+)".*/\1/')
curl -fOL "https://github.com/wagoodman/dive/releases/download/v${DIVE_VERSION}/dive_${DIVE_VERSION}_linux_amd64.rpm"
rpm -i dive_${DIVE_VERSION}_linux_amd64.rpm

Arch Linux

extraリポジトリで利用可能で、pacmanでインストールできます:

root@kitploit:~
pacman -S dive

Mac

Homebrewを使用する場合:

root@kitploit:~
brew install dive

MacPortsを使用する場合:

root@kitploit:~
sudo port install dive

または、リリースページから最新のDarwinビルドをダウンロードしてください。

Windows

Chocolateyを使用する場合

root@kitploit:~
choco install dive

scoopを使用する場合

root@kitploit:~
scoop install main/dive

wingetを使用する場合:

root@kitploit:~
winget install --id wagoodman.dive

または、リリースページから最新のWindowsビルドをダウンロードしてください。

Go tools Goバージョン1.10以上が必要です。

root@kitploit:~
go install github.com/wagoodman/dive@latest

注意: この方法でインストールすると、dive -v を実行した際に適切なバージョンが表示されません。

Nix/NixOS

NixOSの場合:

root@kitploit:~
nix-env -iA nixos.dive

非NixOS(Linux、Mac)の場合

root@kitploit:~
nix-env -iA nixpkgs.dive

X-CMD

x-cmdは、shellとawkで構築された軽量パッケージマネージャーを提供するPosix Shell向けツールボックスです。

root@kitploit:~
x env use dive

Docker

root@kitploit:~
docker pull docker.io/wagoodman/dive
# or alternatively
docker pull ghcr.io/wagoodman/dive

実行時にはDockerソケットファイルを含める必要があります:

root@kitploit:~
docker run --rm -it \
    -v /var/run/docker.sock:/var/run/docker.sock \
    docker.io/wagoodman/dive:latest <dive arguments...>

Windows向けDocker(PowerShell互換の改行を示しています;コマンドプロンプト互換のためには1行に折りたたんでください)

root@kitploit:~
docker run --rm -it `
    -v /var/run/docker.sock:/var/run/docker.sock `
    docker.io/wagoodman/dive:latest <dive arguments...>

注意: ローカルで実行しているDockerのバージョンによっては、Docker APIバージョンを環境変数として指定する必要がある場合があります:

root@kitploit:~
   DOCKER_API_VERSION=1.37 dive ...

またはDockerイメージで実行する場合:

root@kitploit:~
docker run --rm -it \
    -v /var/run/docker.sock:/var/run/docker.sock \
    -e DOCKER_API_VERSION=1.37 \
    docker.io/wagoodman/dive:latest <dive arguments...>

代替ランタイム(Colimaなど)を使用している場合は、ローカルイメージをプルするためにDockerホストを環境変数として指定する必要がある場合があります:

root@kitploit:~
   export DOCKER_HOST=$(docker context inspect -f '{{ .Endpoints.docker.Host }}')

CI統合

環境変数 CI=true を設定してdiveを実行すると、diveのUIがバイパスされ、代わりにDockerイメージを分析し、リターンコードを介して合格/不合格の表示を行います。現在、リポジトリのルートに配置できる .dive-ci ファイルを介して3つのメトリックがサポートされています:

root@kitploit:~
rules:
  # If the efficiency is measured below X%, mark as failed.
  # Expressed as a ratio between 0-1.
  lowestEfficiency: 0.95

  # If the amount of wasted space is at least X or larger than X, mark as failed.
  # Expressed in B, KB, MB, and GB.
  highestWastedBytes: 20MB

  # If the amount of wasted space makes up for X% or more of the image, mark as failed.
  # Note: the base image layer is NOT included in the total image size.
  # Expressed as a ratio between 0-1; fails if the threshold is met or crossed.
  highestUserWastedPercent: 0.20

--ci-config オプションでCI設定パスを上書きできます。

キーバインド

UI設定

設定は不要ですが、設定ファイルを作成して値を上書きできます:

root@kitploit:~
# supported options are "docker" and "podman"
container-engine: docker
# continue with analysis even if there are errors parsing the image archive
ignore-errors: false
log:
  enabled: true
  path: ./dive.log
  level: info

# Note: you can specify multiple bindings by separating values with a comma.
# Note: UI hinting is derived from the first binding
keybinding:
  # Global bindings
  quit: ctrl+c
  toggle-view: tab
  filter-files: ctrl+f, ctrl+slash
  close-filter-files: esc
  up: up,k
  down: down,j
  left: left,h
  right: right,l

  # Layer view specific bindings
  compare-all: ctrl+a
  compare-layer: ctrl+l

  # File view specific bindings
  toggle-collapse-dir: space
  toggle-collapse-all-dir: ctrl+space
  toggle-added-files: ctrl+a
  toggle-removed-files: ctrl+r
  toggle-modified-files: ctrl+m
  toggle-unmodified-files: ctrl+u
  toggle-filetree-attributes: ctrl+b
  page-up: pgup,u
  page-down: pgdn,d

diff:
  # You can change the default files shown in the filetree (right pane). All diff types are shown by default.
  hide:
    - added
    - removed
    - modified
    - unmodified

filetree:
  # The default directory-collapse state
  collapse-dir: false

  # The percentage of screen width the filetree should take on the screen (must be >0 and <1)
  pane-width: 0.5

  # Show the file attributes next to the filetree
  show-attributes: true

layer:
  # Enable showing all changes from this layer and every previous layer
  show-aggregated-changes: false

diveは以下の場所で設定を検索します:

  • $XDG_CONFIG_HOME/dive/*.yaml
  • $XDG_CONFIG_DIRS/dive/*.yaml
  • ~/.config/dive/*.yaml
  • ~/.dive.yaml

必要に応じて .yaml の代わりに .yml を使用できます。

ツールをダウンロード
キーバインド説明
Ctrl + C または Q終了
Tabレイヤービューとファイルツリービューを切り替える
Ctrl + Fファイルをフィルタリング
ESCフィルタファイルを閉じる
PageUp または U1ページ上にスクロール
PageDown または D1ページ下にスクロール
Up または Kページ内で1行上に移動
Down または Jページ内で1行下に移動
Ctrl + Aレイヤービュー:集約されたイメージ変更を表示
Ctrl + Lレイヤービュー:現在のレイヤーの変更を表示
Spaceファイルツリービュー:ディレクトリを折りたたむ/展開する
Ctrl + Spaceファイルツリービュー:すべてのディレクトリを折りたたむ/展開する
Ctrl + Aファイルツリービュー:追加されたファイルの表示/非表示
Ctrl + Rファイルツリービュー:削除されたファイルの表示/非表示
Ctrl + Mファイルツリービュー:変更されたファイルの表示/非表示
Ctrl + Uファイルツリービュー:未変更のファイルの表示/非表示
Ctrl + Bファイルツリービュー:ファイル属性の表示/非表示
PageUp または Uファイルツリービュー:1ページ上にスクロール
PageDown または Dファイルツリービュー:1ページ下にスクロール