Pass variables inside fig.yml on runtime
Problem
Is it possible to configure a fig.yml in such way that you can pass on execution time variables instead of hard-wiring them inside the fig.yml? I think a generic variable injection during execution would be quite useful for various use cases. e.g: <pre> jenkins: image: aespinosa/jenkins:latest ports: - "8080" hostname: ${HOSTNAME} </pre> HOSTNAME=ci fig up That could inject the variable HOSTNAME inside the fig.yml during execution and execute a docker run with hostname `ci`. ps. This is different than passing environment variables inside docker which is already supported (http://www.fig.sh/yml.html#environment)
Unverified for your environment
Select your OS to check compatibility.
1 Fix
Solution: Pass variables inside fig.yml on runtime
Good idea - i've also found it really handy when passing env. variable as a parameter in automated test run :smile: But does your example imply passing all the variables from current users shell session? I'd rather see this like in docker [code block]
Trust Score
1 verification
- 1
Good idea - i've also found it really handy when passing env. variable as a para
But does your example imply passing all the variables from current users shell session? I'd rather see this like in docker
textfig up -d -e HOSTNAME:ci
Validation
Resolved in docker/compose GitHub issue #495. Community reactions: 0 upvotes.
Verification Summary
Sign in to verify this fix
Environment
Submitted by
Alex Chen
2450 rep