We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Let's say I have an env file like this: docker.env
App__PathToFiles="C:\\Program Files\\SOMEPATH\\" App__SomeOtherKey="Value"
and then passing it as an envfile in docker compose docker-compose.yaml
version: '3.3' services: app: image: alpine container_name: app tty: true env_file: - ./docker.env
Running docker-compose up with that config produces this error:
docker-compose up
WARNING: Python-dotenv could not parse statement starting at line 1
This is because bashlash telling env to ignore the double quote which will break the structure of the config.
The text was updated successfully, but these errors were encountered:
Hi @LQss11, I believe it is due to the unnecessary double quotes in the variable value.
I tested it with the same content and it didn't work either.
% cat > appsettings.json <<EOF { "App": { "PathToFiles": "C:\\\\Program Files\\\\SOMEPATH\\\\", "SomeOtherKey": "Value" } } EOF % dotnet-appsettings-env-darwin-arm64 -type docker | tee docker.env App__PathToFiles="C:\\Program Files\\SOMEPATH\\" App__SomeOtherKey="Value" $ cat > docker-compose.yml <<EOF version: '3.3' services: app: image: alpine container_name: app tty: true env_file: - ./docker.env EOF % docker-compose up unexpected character "\"" in variable name near "Value\"\n"
Removing the double quotes worked as expected.
% dotnet-appsettings-env-darwin-arm64 -type docker | tr -d \" | tee docker.env App__PathToFiles=C:\\Program Files\\SOMEPATH\\ App__SomeOtherKey=Value % docker-compose up -d [+] Running 2/2 ⠿ Network x_default Created 0.0s ⠿ Container app Started 0.2s % docker exec -it app ash / # env HOSTNAME=e733b8d2435c App__SomeOtherKey=Value SHLVL=1 HOME=/root TERM=xterm PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin PWD=/ App__PathToFiles=C:\\Program Files\\SOMEPATH\\
Can you remove the double quotes from your docker.env file and see if it will work?
Sorry, something went wrong.
dassump
No branches or pull requests
Let's say I have an env file like this:
docker.env
and then passing it as an envfile in docker compose
docker-compose.yaml
Running
docker-compose up
with that config produces this error:This is because bashlash telling env to ignore the double quote which will break the structure of the config.
The text was updated successfully, but these errors were encountered: