Skip to content

Compose support flow sequence written as a comma separated list within square brackets? #2750

Closed

Description

@ruffsl

I'm just testing a simple foo bar example using variable substitution:

test:
  image: ubuntu
  volumes: ${FOO_BAR}
  command: ping 127.0.0.1

but am encountering this:

$ mkdir /tmp/foo
$ mkdir /tmp/bar
$ export FOO_BAR="['/tmp/bar:/bar', '/tmp/foo:/foo']"
$ docker-compose up
ERROR: Validation failed in file './docker-compose.yml', reason(s):
Service 'test' configuration key 'volumes' contains an invalid type, it should be an array

Does compose support this YAML spec, or am I doing something improper?
http://yaml.org/spec/1.2/spec.html#id2759963
relevant context: NVIDIA/nvidia-docker#39

Activity

  1. dnephin commented on Jan 26, 2016

    @dnephin

    This is the same idea as #2730, only scalar strings are supported. You could set a single value, or have a variable for each, but you can't set an array in a variable.

  2. tiry commented on Jan 26, 2016

    @tiry

    This is indeed the same issue.
    Looks like based on the service_schema jsonschema we could try an "automatic cast" after the interpolation.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions