Seems that support for environment variables in the docker compose file can fail
This is I believe valid configuration, using an Env Var to hold details of a volume. Certainly it works using docker compose command lines but fails in Ruby
Use an Env variable to hold details of a volume in docker-compose.yml
What do you expect
That the associated value from the environment would replace the place holder and be used by Docker compose to build service
What happened instead
Raises exception
Causes error
Docker::Error::ServerError: create ${DOCKER_HOST_DATA_DIR}: "${DOCKER_HOST_DATADIR}" includes invalid characters for a local volume name, only "[a-zA-Z0-9][a-zA-Z0-9.-]" are allowed
Docker::Error::ServerError: create ${DOCKER_HOST_DATA_DIR}: "${DOCKER_HOST_DATA_DIR}" includes invalid characters for a local volume name, only "[a-zA-Z0-9][a-zA-Z0-9_.-]" are allowed
/git/rubystack-2.3.1-6/ruby/lib/ruby/gems/2.3.0/gems/docker-api-1.33.2/lib/docker/connection.rb:50:in `rescue in request'
/git/rubystack-2.3.1-6/ruby/lib/ruby/gems/2.3.0/gems/docker-api-1.33.2/lib/docker/connection.rb:38:in `request'
/git/rubystack-2.3.1-6/ruby/lib/ruby/gems/2.3.0/gems/docker-api-1.33.2/lib/docker/connection.rb:65:in `block (2 levels) in <class:Connection>'
/git/rubystack-2.3.1-6/ruby/lib/ruby/gems/2.3.0/gems/docker-api-1.33.2/lib/docker/container.rb:337:in `create'
/home/git/docker-compose-api/lib/docker-compose/models/compose_container.rb:96:in `prepare_container'
/home/git/docker-compose-api/lib/docker-compose/models/compose_container.rb:210:in `start'
Description
Seems that support for environment variables in the docker compose file can fail
This is I believe valid configuration, using an Env Var to hold details of a volume. Certainly it works using docker compose command lines but fails in Ruby
How to reproduce
Use an Env variable to hold details of a volume in docker-compose.yml
What do you expect
That the associated value from the environment would replace the place holder and be used by Docker compose to build service
What happened instead
Raises exception
Causes error
Docker::Error::ServerError: create ${DOCKER_HOST_DATA_DIR}: "${DOCKER_HOST_DATADIR}" includes invalid characters for a local volume name, only "[a-zA-Z0-9][a-zA-Z0-9.-]" are allowed
Software:
docker-compose version 1.7.1, build 6c29830
gems
Full backtrace