sameersbn / sameersbn/docker-gitlab
migrate from envvar to docker "secrets"
Nobody has claimed this yet.
- Dominant language
- Shell
- Stars
- 8.1k
- Forks
- 2.1k
- Avg merge
- 17h 47m
- Merged PRs (30d)
- 7
Description
I'm curious what your take is on the use of docker "secrets". They tend to be used more for swarms, but there are some indications that they can be used elsewhere, either as a "swarm of 1" or even directly in docker-compose.
I see a few ways to deal with this:
- Fastest: write a script that internally takes all relevant keys in
/run/secrets/and applies them to the appropriate envvars. This is transitional in that current implementations will not break, but the envvars are still visible on the command line (including all passwords). - Backward-compatible: where each envvar is used, try to use the secret-file first, fall-back to the envvar if not present. This allows the most flexibility in that current implementations will not break, but it will require a little more work, essentially writing a function
runsecret_or_envvar()and setting up for it. - Break compatibility: where each envvar is used, completely change over to
/run/secrets/. This takes a little less work than number 2, but is hard to justify to your subscribers/followers.
I suggest number 2, and can work on a PR if you're interested. Because I tend to trail one major version (I'm on 9.5.5 right now), I don't know if my PR will have any issues with the current master. I know you are swamped with Issues and PRs, so I will do the work if you are interested and will be able to merge it.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing how the Docker image currently reads and exposes environment variables, then compare that with Docker secrets mounted under /run/secrets/ and the docker-compose configuration. The issue proposes a backward-compatible secret-file-first fallback, but no files or tests are identified; done would require an agreed migration scope and validation that existing environment-variable setups still work.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, docker-compose, shell
- Domain
- devops, infrastructure, security
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 15/100