From 221e475192dc6f09e934945609ab370f399bf2ab Mon Sep 17 00:00:00 2001 From: Louis-Arnaud Catoire Date: Fri, 17 Apr 2026 21:42:55 +0200 Subject: [PATCH 1/2] compose-file: note that environment source isn't supported by stack deploy docker stack deploy goes through cli/compose/convert which only reads the file source and ignores environment. The command fails to read the secret or config when only environment is set. Closes #23678 --- content/reference/compose-file/configs.md | 6 ++++++ content/reference/compose-file/secrets.md | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/content/reference/compose-file/configs.md b/content/reference/compose-file/configs.md index 860f16895e90..7ad9473e2212 100644 --- a/content/reference/compose-file/configs.md +++ b/content/reference/compose-file/configs.md @@ -87,4 +87,10 @@ configs: environment: "SIMPLE_CONFIG_VALUE" ``` +> [!IMPORTANT] +> +> The `environment` source isn't supported by `docker stack deploy`: +> the command fails to read the config. Use the `file` source, or an +> `external` config created with `docker config create`. + If `external` is set to `true`, all other attributes apart from `name` are irrelevant. If Compose detects any other attribute, it rejects the Compose file as invalid. diff --git a/content/reference/compose-file/secrets.md b/content/reference/compose-file/secrets.md index 136ccab20dd6..3b87ad8f8376 100644 --- a/content/reference/compose-file/secrets.md +++ b/content/reference/compose-file/secrets.md @@ -39,6 +39,13 @@ secrets: environment: "OAUTH_TOKEN" ``` +> [!IMPORTANT] +> +> The `environment` source isn't supported by `docker stack deploy`: +> the command fails to read the secret. Use the `file` source, or an +> [`external`](/manuals/engine/swarm/secrets.md) secret created with +> `docker secret create`. + ## Additional resources For more information, see [How to use secrets in Compose](/manuals/compose/how-tos/use-secrets.md). From e5bb928750bd270ef5632f5723f29d897d5d40e8 Mon Sep 17 00:00:00 2001 From: Louis-Arnaud Catoire Date: Fri, 17 Apr 2026 21:46:08 +0200 Subject: [PATCH 2/2] review: broaden content to configs content source and link external --- content/reference/compose-file/configs.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/content/reference/compose-file/configs.md b/content/reference/compose-file/configs.md index 7ad9473e2212..ada26d0309e6 100644 --- a/content/reference/compose-file/configs.md +++ b/content/reference/compose-file/configs.md @@ -89,8 +89,9 @@ configs: > [!IMPORTANT] > -> The `environment` source isn't supported by `docker stack deploy`: -> the command fails to read the config. Use the `file` source, or an -> `external` config created with `docker config create`. +> The `environment` and `content` sources aren't supported by +> `docker stack deploy`: the command fails to read the config. Use the +> `file` source, or an [`external`](/manuals/engine/swarm/configs.md) +> config created with `docker config create`. If `external` is set to `true`, all other attributes apart from `name` are irrelevant. If Compose detects any other attribute, it rejects the Compose file as invalid.