Skip to content

Support no-new-privileges in docker stack deploy - #7574

Open
lmachineone wants to merge 3 commits into
docker:masterfrom
lmachineone:7573-stack-no-new-privileges
Open

lmachineone wants to merge 3 commits into
docker:masterfrom
lmachineone:7573-stack-no-new-privileges

Conversation

@lmachineone

@lmachineone lmachineone commented Dec 4, 2026 •

Copy link
Copy Markdown

Closes #7573

Summary

  • Carry Compose security_opt entries for no-new-privileges into the Swarm service spec on create and update, alongside any configured credential spec.
  • Reject an enabled setting before stack changes when the negotiated Engine API is older than 1.44. Warn per service about unsupported security option entries while omitting their values.
  • Add Compose loader, conversion, and command tests, and document the Engine requirement.

Validation

  • Passed go test ./cli/compose/... ./cli/command/stack/... using the repository's module wrapper. The command tests use a fake HTTP transport to check API negotiation and the service create and update payloads.
  • Generated the YAML command reference with the repository's docs generator and verified the new Stack documentation appears in its output.
  • Ran the 91-package selection from make test-unit on macOS arm64. Two failures reproduced on unchanged upstream commit 526f63f14e0855238cd4a63b5a6dfae3fecd1eb8 with the same errors: TestContainerExportOutputToFile (GID mismatch) and TestBuilderBroken (exec format error). Both runs had the same package outcomes.
  • Daemon-backed end-to-end tests were outside this local run.

Release notes

Support the Compose no-new-privileges setting in docker stack deploy on Engine API 1.44 and later.

Apply the Compose security option to the Swarm service spec. Reject enabled settings with older negotiated API versions before changing stack resources.

Closes docker#7573.

Signed-off-by: Lucas Manchine <lucasperinm@gmail.com>
Warn about unsupported entries without implying that stack deploy ignored the entire Compose property. Keep option values out of diagnostics.

Signed-off-by: Lucas Manchine <lucasperinm@gmail.com>
Signed-off-by: Lucas Manchine <lucasperinm@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support no-new-privileges in docker stack deploy

1 participant