From a5886c9af47263e2579f2719a50f538eaba3a632 Mon Sep 17 00:00:00 2001 From: aevesdocker Date: Wed, 5 Feb 2025 10:50:53 +0000 Subject: [PATCH] add shortcode --- .../how-tos/{depent-images.md => dependent-images.md} | 6 ++---- data/summary.yaml | 4 +++- 2 files changed, 5 insertions(+), 5 deletions(-) rename content/manuals/compose/how-tos/{depent-images.md => dependent-images.md} (98%) diff --git a/content/manuals/compose/how-tos/depent-images.md b/content/manuals/compose/how-tos/dependent-images.md similarity index 98% rename from content/manuals/compose/how-tos/depent-images.md rename to content/manuals/compose/how-tos/dependent-images.md index 005cba4cbae9..a8a462539c9b 100644 --- a/content/manuals/compose/how-tos/depent-images.md +++ b/content/manuals/compose/how-tos/dependent-images.md @@ -5,6 +5,8 @@ title: Build dependent images weight: 50 --- +{{< summary-bar feature_name="Compose dependent images" >}} + To reduce push/pull time and image weight, a common practice for Compose applications is to have services share base layers as much as possible. You will typically select the same operating system base image for all services. But you also can get one step further sharing image layers when your images share the same @@ -19,7 +21,6 @@ image and install system package `openssl`. The recommended approach is to group the shared declaration in a single Dockerfile, and use multi-stage features so that service images are built from this shared declaration. - Dockerfile: ```dockerfile @@ -53,7 +54,6 @@ A popular pattern is to reuse a service image as a base image in another service As Compose does not parse the Dockerfile, it can't automatically detect this dependency between services to correctly order the build execution. - a.Dockerfile: ```dockerfile @@ -82,7 +82,6 @@ services: dockerfile: b.Dockerfile ``` - Legacy Docker Compose v1 used to build images sequentially, which made this pattern usable out of the box. Compose v2 uses BuildKit to optimise builds and build images in parallel and requires an explicit declaration. @@ -107,7 +106,6 @@ services: service_a: "service:a" ``` - ## Build with Bake Using [Bake](/manuals/build/bake/_index.md) let you pass the complete build definition for all services diff --git a/data/summary.yaml b/data/summary.yaml index b7cfa2076309..770f11f9e24b 100644 --- a/data/summary.yaml +++ b/data/summary.yaml @@ -67,8 +67,10 @@ Compose bridge: availability: Experimental Config profiles: requires: Docker Desktop 4.36 and later +Compose dependent images: + requires: Docker Compose [2.22.0](/manuals/compose/releases/release-notes.md#2220) and later Compose cgroup: - requires: Docker Compose [2.15.0](/manuals/compose/releases/release-notes.md#2200) and later + requires: Docker Compose [2.15.0](/manuals/compose/releases/release-notes.md#2150) and later Compose develop: requires: Docker Compose [2.22.0](/manuals/compose/releases/release-notes.md#2220) and later Compose driver opts: