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

docker-compose does not pass environment variables true/false unchanged #1788

Closed
jsonxr opened this issue Jul 29, 2015 · 1 comment
Closed
Assignees
Labels
Milestone

Comments

@jsonxr
Copy link

jsonxr commented Jul 29, 2015

docker-compose does not pass environment variable 'true', 'false', 'yes', 'no' (without quotes) unchanged to the container. YML parser recognizes these values as a boolean and converts them to either True or False. This is confusing since environment variables are generally just a string. I would expect all values to be passed to the container exactly as defined in the yml file as if they were a string.

Simple work around is to force them to be a string by quoting all environment variables.

test.sh

echo $SHOW

docker-compose.yml

test:
  image: ubuntu
  environment:
    SHOW: true
  command: sh /tmp/test.sh
  volumes:
    - './test.sh:/tmp/test.sh'

Expected Output:

test_1 | true

Actual Output:

test_1 | True

Work Around:

Put all environment variables in quotes to force it to behave as a string.

test:
  image: ubuntu
  environment:
    SHOW: 'true'
  command: sh /tmp/test.sh
  volumes:
    - './test.sh:/tmp/test.sh'
@aanand
Copy link

aanand commented Jul 29, 2015

Yep, this should be part of #129

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

No branches or pull requests

3 participants