Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

publish updates from main #22137

Merged
merged 6 commits into from
Mar 3, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update example in the Compose Build Specification (additional_context…
…s) to ease it's understanding (#22140)

There might by a slight error when illustrating the
`additional_contexts` attribute. The compose file declares two services
with the same name. It might induce misunderstanding, especially since
the second service's image uses the first one to build upon.

## Description

I replaced the key defining the second service of the compose file used
to illustrate the `additional_contexts` attribute, since the key `base`
is used twice. Of course, any better replacement could be used, instead
of `my-service`.

It is invalid to use the same key twice (the error: `mapping key "base"
already defined at line 2` is expected on `docker compose up`), and it
does harm the understanding of the illustrated point of building a
service's image using another one to share layers.

## Reviews

<!-- Notes for reviewers here -->
<!-- List applicable reviews (optionally @tag reviewers) -->

- [ ] Technical review
- [ ] Editorial review
- [ ] Product review
  • Loading branch information
eguerlain authored Mar 3, 2025
commit 1278c5b4c801adf38b2ee2d4a7aa48abef1bc1dc
2 changes: 1 addition & 1 deletion content/reference/compose-file/build.md
Original file line number Diff line number Diff line change
@@ -130,7 +130,7 @@ services:
dockerfile_inline: |
FROM alpine
RUN ...
base:
my-service:
build:
context: .
dockerfile_inline: |