Build Secret Mount とは何か?
build secret mount は、シークレットをレイヤーに書き込むことなく、特定の build ステップに対して一時的なファイルまたは環境値として利用可能にする BuildKit の機能です。シークレットはそのステップの実行中だけ mount され、イメージや build cache に永続化されることはありません。build 中にトークンを使う安全な方法です。
なぜ重要か
シークレットを build 引数で渡したりコピーして入れたりすると、それらがイメージの履歴に漏れ、イメージを持つ誰もが取り出せてしまいます。secret mount は資格情報をすべてのレイヤーと cache エントリの外に保つため、公開されるイメージはクリーンなままです。これは、build 時にのみ必要なプライベートパッケージのトークンで特に重要です。
関連ガイド
What Is a BuildKit Frontend?A BuildKit frontend translates a build definition such as a Dockerfile into the low-level build graph that Bu…
What Is a Squashed Image?A squashed image is a container image whose build layers have been collapsed into one, hiding intermediate co…
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…