Skip to content
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

env_file not able to parse spaces #3240

Closed
altsalt opened this issue Mar 30, 2016 · 5 comments
Closed

env_file not able to parse spaces #3240

altsalt opened this issue Mar 30, 2016 · 5 comments

Comments

@altsalt
Copy link

altsalt commented Mar 30, 2016

Currently, there appears to be no way to add a space character to an env_file entry.

Here are some of the combinations I have tried:

VAR=foo bar
VAR=foo\ bar
VAR='foo bar'
VAR="foo bar"
VAR='foo\ bar'
VAR={foo bar}
"VAR='foo bar'"
'VAR="foo bar"'
VAR=foo%20bar
VAR=foo bar
etc ...

I am using Docker 1.10.3 and Compose 1.7.0

This issue seems to be directly related to moby/moby#12997 which looked to be closed unsatisfactorily.

Another related issue may be: #2854

Any fix or work-around would be appreciated.

Thanks!

@dnephin
Copy link

dnephin commented Mar 31, 2016

My understanding is that the first one should work. The quotes will be taken literally, so nothing with quotes will be correct.

@altsalt
Copy link
Author

altsalt commented Mar 31, 2016

Unfortunately it just ends up as VAR=foo

@dnephin
Copy link

dnephin commented Apr 1, 2016

$ docker run -ti --env-file envs alpine:3.3 env
WITH_SPACE=foo bar
WITH_ESCAPE=foo\ bar

$ docker-compose up
Creating network "envfile_default" with the default driver
Creating envfile_web_1
Attaching to envfile_web_1
web_1  | WITH_ESCAPE=foo\ bar
web_1  | WITH_SPACE=foo bar
envfile_web_1 exited with code 0

Seems to work for me with both space and backslash. I suspect the issue is in the script you're using to consume the variable.

@junneyang
Copy link

so, what's the solution?

@takano32
Copy link

takano32 commented Dec 4, 2019

@junneyang
this issue may be duped with #2854 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants