docs icon indicating copy to clipboard operation
docs copied to clipboard

Setting secrets from environment variables doesn't work in a swarm deploy

Open quentinsf opened this issue 1 month ago • 0 comments

Is this a docs issue?

  • [x] My issue is about the documentation content or website

Type of issue

Information is incorrect

Description

It would be nice to have a note in the documentation to the effect that setting secrets from environment variables. eg:

secrets:
  borg_backup_ssh_key:
    environment: "BORG_BACKUP_SSH_KEY"

work when the compose file is used for docker compose, but NOT when it is used for docker stack deploy. It appears that a file source is needed then.

Location

https://docs.docker.com/reference/compose-file/secrets/

Suggestion

It would be wonderful if the code could be fixed to allow this, but in the meantime, a note to the effect that the 'environment' clause only works in certain... ahem... environments would be very helpful.

quentinsf avatar Nov 08 '25 11:11 quentinsf