イメージレイヤー - CI/CD用語集の定義
イメージレイヤーは、コンテナイメージにおける不変でコンテンツアドレス指定された1つのファイルシステム変更です。Dockerfileのうちファイルシステムを変更する各命令(COPY、RUN、ADD)がレイヤーを生成し、それらのレイヤーが積み重なって最終的なルートファイルシステムを形成します。
レイヤーがCI速度にとって重要な理由
レイヤーはdigestによってキャッシュされ、共有されます。初期のレイヤー(例えば依存関係のインストール)が変更されていなければ、registryとbuildホストは再ビルドせずにそれを再利用します。これが、Dockerfileを変更の少ないものから多いものへと並べるとCIが速くなる主な理由です。
レイヤーの確認
Terminal
docker history myimage:latest
docker buildx imagetools inspect myimage:latest関連ガイド
OCI Image - CI/CD Glossary DefinitionOCI Image: An OCI image is a container image that follows the Open Container Initiative image specification:…
Image Digest - CI/CD Glossary DefinitionAn image digest is the immutable SHA-256 hash identifying an exact container image. Pinning to a digest guara…
Distroless Image - CI/CD Glossary DefinitionDistroless Image: A distroless image is a minimal base image that contains only your application and its runt…