roadmap icon indicating copy to clipboard operation
roadmap copied to clipboard

Creating docker secrets from .env file

Open kasir-barati opened this issue 3 years ago • 1 comments

Tell us about your request I like to be able to create many secrets which are listed in KEY=VALUE or KEY="This is a text" format. this values will be in a .env file.

Which service(s) is this request for? docker swarm, docker secrets

Tell us about the problem you're trying to solve. What are you trying to do, and why is it hard? I read this article and after that I though with myself why this should be such a painful task to register my secrets.

Are you currently working around the issue? I prefer to write a custom bash script to read the .env file and register them one by one.

Additional context Here is what I mean by a .env file:

POSTGRES_PASSWORD=123456789
AMAZON_API_KEY=asd4da5s74d5a4sd54
$ docker secret create --env-file .env

kasir-barati avatar Oct 20 '22 17:10 kasir-barati

I had to implement a workaround to get this working in Docker Swarm. It would be great to have the same level of support as in Docker Compose. It’s odd that it’s missing, given we’re using the same compose file — it creates misleading expectations. Overall, the user experience with Swarm suffers because of these small inconsistencies.

landsman avatar Oct 08 '25 09:10 landsman