Squashed Image とは何か?
squashed image とは、個々の build レイヤーが単一のレイヤーに統合されたコンテナイメージです。squash により、以前のレイヤーが残した可能性のある中間ファイルやシークレットが取り除かれ、ディスク上のイメージサイズを縮小できます。トレードオフは、統合されたレイヤーが他のイメージと cache を共有しなくなることです。
なぜ重要か
squash は、以前のレイヤーが書き込んだファイルを後のレイヤーが削除した場合に役立ちます。削除されたバイトは squash されるまで元のレイヤーを占有し続けるためです。しかし、すべてを 1 つのレイヤーにまとめると、pull のたびに全体が再ダウンロードされ、レイヤーの再利用が損なわれます。multi-stage build は通常、共有を失うことなく同じクリーンさを実現します。
関連ガイド
What Is an Image Layer?An image layer is one filesystem diff in a container image; layers stack to form the final filesystem and are…
What Is a Build Secret Mount?A build secret mount exposes a credential to a single build step at runtime without baking it into any image…
What Is a BuildKit Frontend?A BuildKit frontend translates a build definition such as a Dockerfile into the low-level build graph that Bu…