I have an application which uses an environment variable named REDIS_URL. A typical REDIS_URL would be redis://172.17.0.5:6379/0. I'd like to be able to populate REDIS_URL based on container linking:
docker run --name redis -d redis
docker run --name firehose --link redis:redis -e REDIS_URL="redis://$REDIS_PORT_6379_TCP_ADDR:$REDIS_PORT_6379_TCP_PORT/0" -d firehose/server
But depending on how I escape the environment variables, they are either evaluated in my shell at docker run time and are blank (redis://:/0), or passed as literal strings (redis://$REDIS_PORT_6379_TCP_ADDR:$REDIS_PORT_6379_TCP_PORT/0).
How can I populate my REDIS_URL application environment variable based on conatiner linking?