docs: fix misleading secrets long syntax target description#25038
Open
mohithshuka wants to merge 5 commits into
Open
docs: fix misleading secrets long syntax target description#25038mohithshuka wants to merge 5 commits into
mohithshuka wants to merge 5 commits into
Conversation
Closes docker#23256 - Added container architecture diagram showing isolated containers sharing the host OS kernel - Added containers vs VMs comparison diagram highlighting the absence of a Guest OS in containers
The post_start example had chown arguments in wrong order. Correct syntax is: chown -R [owner:group] [path] Fixes docker#24853
The previous examples used CMD (exec form) with curl but without || exit 1. Since CMD uses exec format, shell operators like || are not available, meaning a non-zero curl exit code may not correctly propagate as unhealthy. CMD-SHELL runs via /bin/sh so || exit 1 works as expected. Fixes docker#23077
The target field description incorrectly stated that an absolute path could be used for an alternate location. This is a Swarm-only feature and is not supported in Docker Compose standalone. Fixes docker#25035
✅ Deploy Preview for docsdocker ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates Docker documentation to correct an inaccurate statement about Compose secrets long syntax, and also includes additional doc edits in unrelated sections.
Changes:
- Remove the claim that
secrets.targetsupports absolute paths in the services reference. - Update
healthcheck.testexamples to useCMD-SHELLwith an explicit|| exit 1. - Add two conceptual diagrams to the “What is a container?” get-started page.
Reviewed changes
Copilot reviewed 2 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| content/reference/compose-file/services.md | Adjusts secrets long-syntax target description; updates healthcheck example commands. |
| content/get-started/docker-concepts/the-basics/what-is-a-container.md | Adds architecture/comparison diagrams to support conceptual explanation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| ```yml | ||
| healthcheck: | ||
| test: ["CMD", "curl", "-f", "http://localhost"] | ||
| test: ["CMD-SHELL", "curl -f http://localhost || exit 1"] |
Comment on lines
1923
to
1926
| - `source`: The name of the secret as it exists on the platform. | ||
| - `target`: The name of the file to be mounted in `/run/secrets/` in the | ||
| service's task container, or absolute path of the file if an alternate location is required. Defaults to `source` if not specified. | ||
| service's task container. Defaults to `source` if not specified. | ||
| - `uid` and `gid`: The numeric uid or gid that owns the file within |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
Removed the incorrect claim that
targetin the secrets long syntaxaccepts an absolute path for an alternate mount location.
Why
The
targetfield only accepts a filename, which gets mounted under/run/secrets/<target>. Specifying an absolute path is a Docker Swarmfeature and is not supported in Docker Compose standalone. This
was misleading users into thinking they could mount secrets at arbitrary
paths in Compose.
Related issue
Fixes #25035