docker-compose


How to do variable substitution in env_file?


I am using docker-compose and I want my env_file to have variable subsitution. I would like to define one variable in the file and then use it in other variables:
APP_ENV=dev-foo
LOCALPATH=/tmp/builddir/${APP_ENV}
GIT_URL=git#github.com:some-org/${APP_ENV}
What is the supported form of variable substitutions in env_file???
Variable substitution is not supported in env_file.
Your options are:
use variables in the environment: section (although you wont be able to do your example because setting a value in environment only sets it for the container environment, and substitution happens on the host).
use host variables by specifying an environment variable without a value (ex: LOCALPATH=), which may be in either the env_file or environment section.

Related Links

Docker Compose port issue. Cannot launch docker project on localhost
Name an image built from running a docker-compose file
Race conditions after changing names in docker-compose.yml
Docker compose - image not found
How to work out the hostname that compose gives containers?
docker-compose restart container if service is dead
Swarm scheduling not working as expected using filters in compose file
issues in buiding Slate with Docker
Invalid type error in Docker Compose
Django cookiecutter with Docker add pip package
Docker Compose + Swarm + Machine Networking issue
docker-compose build image parameters --force-rm --pull
linking 2 containers through docker compose
Files created by manage.py commands not chown'd from root user
Is it possible to create an intermediate image within docker-compose?
docker-compose service listen on specified interface

Categories

HOME
msbuild
itunesconnect
sip
casting
reference
ebay-api
data-modeling
assign
squeak
mailchimp
cdn
webpack-dev-server
box-api
spring-data-solr
angular-universal
ndepend
camunda
tmux
hql
loss
multibinding
amazon-data-pipeline
internet-explorer-7
openam
ofbiz
cucumberjs
audio-streaming
django-rest-auth
descriptor
minimagick
git-branch
fastboot
pumping-lemma
datastax-enterprise
datanucleus
jopendocument
cqlsh
folder
overflow
jql
snapkit
restler
respect-validation
nscollectionview
tapply
redbean
cakephp-3.2
logan-square
stanford-nlp-server
extjs3
sharpdevelop
fluent-nhibernate-mapping
richtext
dmalloc
try-catch-finally
directinput
turbolinks
glade
dimensionality-reduction
class-design
altova
cosign-api
sbt-proguard
aws-kms
dcast
methodology
apache2-module
github-for-mac
consul-template
polarion
p4python
transparentproxy
data-representation
beagleboard
douglas-peucker
jsonmodel
grunt-contrib-connect
react-os
breeze-sharp
system.net
worklight-appcenter
connections
pthreads-win32
nativequery
svg-android
code-complete
exi
django-tinymce
parsec
qvariant
zipstream
javah
azure-appfabric
conditional-operator
text-manipulation
expander
hotfix
tracd

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App