-
-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issues with password in Docker .env #239
Comments
The solution for anyone else who wishes to do this: In your .env file, single quote the value, but do not escape it. .env file: TIMETAGUSER="myuser"
TIMETAGPASS='$2a$08$qFFehmqHMmIwR91g77N9xOc.eA8pkRE64zXwJo/AR/fWTbGrEgHEm' docker-compose file: environment:
- TIMETAGGER_CREDENTIALS=$TIMETAGUSER:${TIMETAGPASS} |
Glad you figured that one out. So if I understand correctly, using the single quotes prevents the dollar signs to be evaluated as variables, right? |
That's correct.
|
I think I reopened this so that we can document this workaround. |
Heya,
Got a weird one, might be user error.
Trying to utilise the bcrypted password in a docker env file:
If I enter the credentials as above, it works as expected.
If I try entering it as an env var it does not:
.env:
docker compose show config
outputs the following:And obviously, if I don't escape the "$", I get the expected problem:
Any thoughts?
I've posted it here too docker/compose#9716 as it seems to be a weird bug with compose, but definitely something to consider as quite a few people use env files when they have a large compose file.
Maybe allow for b64 encodings of the bcrypt hash to remove the "$"/special characters to allow things to function more smoothly in Docker?
The text was updated successfully, but these errors were encountered: