File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
content/reference/compose-file Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -118,6 +118,28 @@ the unused contexts.
118118Illustrative examples of how this is used in Buildx can be found
119119[here](https://github.com/docker/buildx/blob/master/docs/reference/buildx_build.md#-additional-build-contexts---build-context).
120120
121+ ` additional_contexts` can also refer to an image built by another service.
122+ This allows a service image to be built using another service image as a base image, and to share
123+ layers between service images.
124+
125+ ` ` ` yaml
126+ services:
127+ base:
128+ build:
129+ context: .
130+ dockerfile_inline: |
131+ FROM alpine
132+ RUN ...
133+ base:
134+ build:
135+ context: .
136+ dockerfile_inline: |
137+ FROM base # image built for service base
138+ RUN ...
139+ additional_contexts:
140+ base: service:base
141+ ` ` `
142+
121143# ## `args`
122144
123145` args` define build arguments, that is Dockerfile `ARG` values.
You can’t perform that action at this time.
0 commit comments