orchardup/fig — pull request #76 by SkinyMonkey (2014-02-04 20:51:40+00:00)
Title: Feature/env

This feature allow you to use environment variables in the fig.yml file.
It simply expand any found environment variable (ex: $HOST) to the value defined in the environment running fig.

useful example :

I'm using Skydock (https://github.com/crosbymichael/skydock) along with skydns.

When i launch a skydns container by hand I need to specify the ip of the docker0 interface so that docker inject a new nameserver into /etc/resolv.conf:

ex:

Here the ip is "172.17.42.1"

`docker run -d -dns 172.17.42.1 -p 172.17.42.1:53:53/udp -name skydns crosbymichael/skydns -nameserver 8.8.8.8:53 -domain docker`

A nice way to be more flexible, compute what is the address automatically for example, is to add an environment variable in the equation :

`env DNS_IP=172.17.42.1 docker run -d -dns $DNS_IP -p $DNS_IP:53:53/udp -name skydns crosbymichael/skydns -nameserver 8.8.8.8:53 -domain docker`

Wouldn't it be nice to be able to do the same thing in a fig.yml file?

ex:

`env DNS_IP=172.17.42.1 fig up`

with this fig.yml:

`skydns:
image: crosbymichael/skydns
ports:
- $DNS_IP:53:53/udp
- 8080:8080
dns:
- $DNS_IP
command: "-nameserver 8.8.8.8:53 -domain docker"`

I wanted to add a flag to make this expansion optional, just in case. What do you think?