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

Literal json string in environment is deserialized by compose #3878

Closed
clinta opened this issue Aug 25, 2016 · 1 comment
Closed

Literal json string in environment is deserialized by compose #3878

clinta opened this issue Aug 25, 2016 · 1 comment

Comments

@clinta
Copy link

clinta commented Aug 25, 2016

version: "2"

services:
  foo:
    image: busybox
    command: sleep 50
    environment:
    - FOOBAR: '{"foo": "bar"}'
# docker-compose up
ERROR: The Compose file './docker-compose.yml' is invalid because:
services.foo.environment contains {"FOOBAR": "{\"foo\": \"bar\"}"}, which is an invalid type, it should be a string

I've tried several different methods of escaping or quoting {"foo": "bar"} but compose won't pass through the string.

@shin-
Copy link

shin- commented Aug 31, 2016

Remove the dash - at the beginning of the line. environment is either a list of strings, like such:

environment:
  - FOOBAR='{"foo": "bar"}'

or a dictionary

environment:
  FOOBAR: '{"foo": "bar"}'

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

2 participants