When I using the "$" sign in passwords within the .env file for Docker Compose, an error occurs during execution, interpreting it as a variable and causing issues in the form of warnings.
WARN[0000] The "m3a" variable is not set. Defaulting to a blank string.
My passwords contains a dollar sign follwed by “m3a” and it is interpreted as a variable
PASSWORD=password$m3a
This is happening because of how docker-compose file reads the password
So there’s some solutions
using double dollars:
PASSWORD=password$$m3a
using apostrophes or double quotes as you would in it:
PASSWORD='password$m3a'
PASSWORD=“password$m3a”
using backslashes to escape the special character.
PASSWORD=password\$he
using the --env-file option when running docker-compose and pass the path to your .env file directly.
docker-compose --env-file /.env_path/.env up
and also I do some research and have an idea:
Maybe if you made some changes in docker-compose.yml file in next version, it completely solves this problem. Please test it and let me know that it is working or not. The changes is using double quotes in yml file under environment and volumes section. Something like below code:
When I using the "$" sign in passwords within the .env file for Docker Compose, an error occurs during execution, interpreting it as a variable and causing issues in the form of warnings.
WARN[0000] The "m3a" variable is not set. Defaulting to a blank string.
My passwords contains a dollar sign follwed by “m3a” and it is interpreted as a variable PASSWORD=password$m3a
This is happening because of how docker-compose file reads the password So there’s some solutions
using double dollars: PASSWORD=password$$m3a
using apostrophes or double quotes as you would in it: PASSWORD='password$m3a' PASSWORD=“password$m3a”
using backslashes to escape the special character. PASSWORD=password\$he
using the --env-file option when running docker-compose and pass the path to your .env file directly. docker-compose --env-file /.env_path/.env up
and also I do some research and have an idea:
environment:
volumes: