-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Open
Description
Not sure what the syntax would be exactly, but I would like to supply an optional and variable set of devices to an docker-compose.yml service.
Seems more flexible if the variable is a string and literally substituted, but maybe shell array variables should be used instead.
DEVICES= # empty set, as a string
DEVICES=() # or, empty set, as an array?
DEVICES='"/dev/sdb:/dev/sdb", "/dev/sdc:/dev/sdc"' # as a string
DEVICES=("/dev/sdb:/dev/sdb" "/dev/sdc:/dev/sdc") # or as an array?
foo:
devices: [ ${DEVICES} ] # not sure of the best syntax
image: ...
It would be great if this syntax allowed "appending" to an existing hard-coded array.
foo:
volumes: [ "/var/foo", ${EXTRA_VOLUMES} ] # not sure of the best syntax
image: ...
Without this feature, I can't use docker-compose directly and instead have to do unnatural things with yml substitution scripts and "docker-compose -f -".
PS: I don't know what's up with docker-compose and Swarm "services" on your roadmap. IMO Compose and the yml service definitions are a really nice way to define both simple and complicated environments.
strongwinderic, squeral, sitkevij, murdav, moble and 60 moreDoom4535, LukaszHem and VityaSchel