Skip to content

docs: Add external property back to compose and add swarm secrets example using compose - #25522

Merged
aevesdocker merged 2 commits into
docker:mainfrom
deahtstroke:docs-update-defining-secrets-for-swarm-compose-files
Aug 27, 2026
Merged

docs: Add external property back to compose and add swarm secrets example using compose#25522
aevesdocker merged 2 commits into
docker:mainfrom
deahtstroke:docs-update-defining-secrets-for-swarm-compose-files

Conversation

@deahtstroke

@deahtstroke deahtstroke commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Description

Added back the attribute external in the /reference/compose/secrets section with a warning that this attribute is only available for Docker Swarm. Additionally, I added a small toy reference example to the section "Defining and using Secrets in compose files" and moved the section outside of the "Examples" section. The reason why I did this is because I noticed the Examples are all runnable steps that showcase concrete usage of secrets, the example I added is just a skeleton/reference to how they should be used in conjunction with docker secret create..., not a true able-to-run example like the ones below. I also changed the hyperlink from /reference/compose-file/legacy-versions.md to /reference/compose-file/secrets.md.

A few caveats that I wasn't sure about when writing this:

  • I'm not sure if using the "[!NOTE]" in the attributes list is the approach maintainers and writers might favor and I can change it accordingly
  • I'd love to hear feedback on moving "Defining and using secrets in compose files" outside of "Examples" due to my reasoning above

Edit:
I'm also not opposed to making a fully working example using compose, stack and secrets and putting the section back under Examples

Related issues or tickets

#25491

Reviews

  • Technical review
  • Editorial review
  • Product review

@deahtstroke
deahtstroke requested a review from dvdksn as a code owner July 9, 2026 01:47
@netlify

netlify Bot commented Jul 9, 2026

Copy link
Copy Markdown

Deploy Preview for docsdocker ready!

Name Link
🔨 Latest commit 4b2d876
🔍 Latest deploy log https://app.netlify.com/projects/docsdocker/deploys/6a8febceae16b90008890366
😎 Deploy Preview https://deploy-preview-25522--docsdocker.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions github-actions Bot added area/engine Issue affects Docker engine/daemon area/compose Relates to docker-compose.yml spec or docker-compose binary area/swarm Issue affects swarm and clustering functionality of docker labels Jul 9, 2026
@dvdksn
dvdksn requested review from aevesdocker and removed request for dvdksn July 24, 2026 12:21
@aevesdocker

Copy link
Copy Markdown
Contributor

Thanks @deahtstroke. The engine/swarm/secrets/ addition makes sense to me and I'm fine with that part.

Could you drop the reference/compose/secrets change, though? Plain docker compose errors with unsupported external secret on that attribute since it requires swarm, so even with the [!NOTE] caveat, documenting it on the generic Compose reference risks readers copying it outside a swarm context and hitting an unexplained CLI error. That page's audience is mostly plain-Compose users. Let's keep external scoped to the swarm-specific page where it's actually valid, and leave the generic reference as-is.

@deahtstroke
deahtstroke force-pushed the docs-update-defining-secrets-for-swarm-compose-files branch 2 times, most recently from d157f0e to 7c21659 Compare August 27, 2026 06:47
@deahtstroke
deahtstroke force-pushed the docs-update-defining-secrets-for-swarm-compose-files branch from 7c21659 to 0d0e6f6 Compare August 27, 2026 06:55
@deahtstroke

deahtstroke commented Aug 27, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the Review! Yeah I hard agree on that rationale, which also makes sense as to why the original issues about the external option being confusing for compose users were opened in the first place. I removed the changes to /content/reference/compose-file/secrets.md 😄

Comment thread content/manuals/engine/swarm/secrets.md Outdated
Comment thread content/manuals/engine/swarm/secrets.md Outdated
Comment thread content/manuals/engine/swarm/secrets.md Outdated
Comment thread content/manuals/engine/swarm/secrets.md Outdated
Co-authored-by: Allie Sadler <102604716+aevesdocker@users.noreply.github.com>

@aevesdocker aevesdocker left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you @deahtstroke!

@aevesdocker
aevesdocker merged commit efa340b into docker:main Aug 27, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/compose Relates to docker-compose.yml spec or docker-compose binary area/engine Issue affects Docker engine/daemon area/swarm Issue affects swarm and clustering functionality of docker

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants