docs icon indicating copy to clipboard operation
docs copied to clipboard

It is not clear that docker compose secret is a file

Open mateuszpawlik opened this issue 1 year ago • 0 comments

Is this a docs issue?

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

Type of issue

I can't find what I'm looking for

Description

Similar to:

  • https://github.com/docker/docs/issues/17768

The line:

file: The secret is created with the contents of the file at the specified path.

is confusing.

After a while I understood that the secret is a file. I cannot simply do:

services:
  neo4j:
    environment:
      - NEO4J_AUTH=/run/secrets/neo4j_auth_file
secrets:
  neo4j_auth_file:
    file: ./neo4j_auth.txt

and assume that NEO4J_AUTH variable will hold the contents of ./neo4j_auth.txt. It's also not clear if I can assign secret's value to an environment variable.

Location

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

Suggestion

It would help if the documentation is clear about secrets being files. This also limits the use cases to secrets being passed as files. It would be nice to learn what to do, when a secret needs to be passed as the value of an environment variable.

mateuszpawlik avatar Oct 18 '24 07:10 mateuszpawlik