Skip to content

assorted dockerfile docs issues#6582

Merged
crazy-max merged 10 commits intomoby:masterfrom
dvdksn:assorted-dockerfile-docs-issues
Mar 17, 2026
Merged

assorted dockerfile docs issues#6582
crazy-max merged 10 commits intomoby:masterfrom
dvdksn:assorted-dockerfile-docs-issues

Conversation

@dvdksn
Copy link
Collaborator

@dvdksn dvdksn commented Mar 16, 2026

  • docs: document no-colon variable modifier variants in environment replacement
  • docs: clarify that only final stage labels appear in output image
  • docs: add example showing a previous build stage used as base image
  • docs: clarify STOPSIGNAL applies to docker stop, not keyboard interrupts
  • docs: clarify exec form CMD should be used with exec form ENTRYPOINT
  • docs: fix misleading shell form ENTRYPOINT language around CMD args
  • docs: clarify RUN --mount=type=bind rw write discard behavior
  • docs: document ** recursive glob support in COPY --parents
  • docs: clarify HEALTHCHECK interval behavior during start period
  • docs: clarify leading whitespace behavior in LegacyKeyValueFormat check

related issues

Fixes docker/docs#14233
Fixes docker/docs#20549
Fixes docker/docs#22940
Fixes docker/docs#23122
Fixes docker/docs#23140
Fixes docker/docs#23165
Fixes docker/docs#23285
Fixes docker/docs#24096
Fixes docker/docs#24308
Fixes docker/docs#24227

@thaJeztah
Copy link
Member

Should probably remove the Fixes https://github.com/docker/docs/issues/XXXX from the commit messages to prevent closing before it's vendored in the docs repo.

@crazy-max
Copy link
Member

Fixes docker/docs#14233, docker/docs#20549, docker/docs#22940, docker/docs#23122, docker/docs#23140, docker/docs#23165, docker/docs#23285, docker/docs#24096, docker/docs#24308, docker/docs#24227

Each issue should be prefixed with fixes to close them. Here it will just close docker/docs#14233

@crazy-max
Copy link
Member

Should probably remove the Fixes https://github.com/docker/docs/issues/XXXX from the commit messages to prevent closing before it's vendored in the docs repo.

I think GitHub doesn't look at commit message to close related issue but PR description.

@thaJeztah
Copy link
Member

it looks at both 😅

@crazy-max
Copy link
Member

dvdksn added 10 commits March 16, 2026 14:37
…lacement

Add documentation for the `${variable-word}` and `${variable+word}`
modifiers which differ from their colon counterparts (`${variable:-word}`
and `${variable:+word}`) in that they only test whether the variable is
unset, rather than unset or empty.

Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
In multi-stage builds, labels from intermediate stages referenced via
COPY --from or RUN --mount=from= are not included in the final output
image.

Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
The FROM instruction description mentioned that a named stage can be
referenced in subsequent FROM instructions, but lacked a concrete example
demonstrating this common multi-stage pattern.

Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
STOPSIGNAL only affects the signal sent by docker stop (and the Docker
daemon). Keyboard shortcuts like Ctrl+C send SIGINT directly, independent
of the STOPSIGNAL setting.

Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
The previous text said "use either form of CMD" which is technically true
but misleading. When using exec ENTRYPOINT, shell-form CMD wraps the
command in /bin/sh -c, which means ENTRYPOINT receives a shell invocation
rather than the bare arguments. Exec form CMD is the expected pairing.

Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
Replace "prevents CMD command line arguments from being used" with
"ignores CMD and docker run command line arguments", which more accurately
describes the behavior: the arguments are not absent, they just aren't
forwarded to the command inside /bin/sh -c.

Also align with the wording used in the Shell form ENTRYPOINT example
section further down.

Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
The terse note "Written data will be discarded" was unexplained. Expand
it to clarify that writes are discarded when the RUN instruction completes
and are not committed to the image layer.

Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
The --parents section only showed simple wildcard examples. Add an
example demonstrating the ** glob pattern, which recursively matches
files across directory levels and is particularly useful with --parents
to preserve deep directory structures.

Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
The description of when health checks run was incomplete. During the
start period, checks run at start-interval frequency (default 5s),
not at the regular interval (default 30s).

Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
When migrating from legacy multi-line ENV/ARG syntax to the modern
key=value format, leading whitespace on continuation lines is preserved
in both syntaxes. Add a note making this explicit so users understand
they may need to adjust indentation when converting.

Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
@dvdksn dvdksn force-pushed the assorted-dockerfile-docs-issues branch from 2f6075d to 2016c37 Compare March 16, 2026 13:37
@dvdksn
Copy link
Collaborator Author

dvdksn commented Mar 16, 2026

are you happy now @thaJeztah @crazy-max 😆

Copy link
Member

@crazy-max crazy-max left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thanks!

@dvdksn
Copy link
Collaborator Author

dvdksn commented Mar 16, 2026

feel free to merge - I don't have write access.

@crazy-max crazy-max merged commit 119aab3 into moby:master Mar 17, 2026
222 of 224 checks passed
@crazy-max crazy-max added this to the v0.29.0 milestone Mar 17, 2026
@dvdksn dvdksn deleted the assorted-dockerfile-docs-issues branch March 17, 2026 12:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment