レイヤーキャッシュ - CI/CD用語集の定義
レイヤーキャッシュは、変更のないイメージレイヤーを再ビルドする代わりに前回のbuildから再利用します。Dockerfileの各命令がレイヤーを作るため、安定したステップ(依存関係のインストールなど)を頻繁に変わるステップより前に並べると、cacheヒットが最大化します。
CIでは
エフェメラルなrunnerはローカルのレイヤーcacheを持たずに開始するため、--cache-to/--cache-from でcacheをレジストリにpushするか、BuildKitのようなbuildバックエンドをリモートcacheとともに使わない限り、buildは遅くなります。
関連ガイド
Container Runtime - CI/CD Glossary DefinitionContainer Runtime: A container runtime is the software that actually runs containers from images, handling pr…
CI Caching Explained: Speed Up Pipelines Without Breaking ThemHow CI caching works, what to cache (dependencies, build outputs, Docker layers), how cache keys and restore…
Cache (CI) - CI/CD Glossary DefinitionCache (CI): A **cache** stores dependencies or build outputs between runs so they are restored instead of rec…