2014-01-27 16:03:21 +01:00
---
layout: default
title: Fig environment variables reference
---
Environment variables reference
===============================
Fig uses [Docker links] to expose services' containers to one another. Each linked container injects a set of environment variables, each of which begins with the uppercase name of the container.
2014-01-30 11:48:25 +01:00
To see what environment variables are available to a service, run `fig run SERVICE env` .
2014-01-27 16:03:21 +01:00
< b >< i > name</ i > \_PORT</ b >< br >
2014-01-27 18:46:46 +01:00
Full URL, e.g. `DB_1_PORT=tcp://172.17.0.5:5432`
2014-01-27 16:03:21 +01:00
< b >< i > name</ i > \_PORT\_< i > num</ i > \_< i > protocol</ i ></ b >< br >
2014-01-27 18:46:46 +01:00
Full URL, e.g. `DB_1_PORT_5432_TCP=tcp://172.17.0.5:5432`
2014-01-27 16:03:21 +01:00
< b >< i > name</ i > \_PORT\_< i > num</ i > \_< i > protocol</ i > \_ADDR</ b >< br >
2014-01-27 18:46:46 +01:00
Container's IP address, e.g. `DB_1_PORT_5432_TCP_ADDR=172.17.0.5`
2014-01-27 16:03:21 +01:00
< b >< i > name</ i > \_PORT\_< i > num</ i > \_< i > protocol</ i > \_PORT</ b >< br >
2014-01-27 18:46:46 +01:00
Exposed port number, e.g. `DB_1_PORT_5432_TCP_PORT=5432`
2014-01-27 16:03:21 +01:00
< b >< i > name</ i > \_PORT\_< i > num</ i > \_< i > protocol</ i > \_PROTO</ b >< br >
2014-01-27 18:46:46 +01:00
Protocol (tcp or udp), e.g. `DB_1_PORT_5432_TCP_PROTO=tcp`
2014-01-27 16:03:21 +01:00
< b >< i > name</ i > \_NAME</ b >< br >
2014-01-27 18:46:46 +01:00
Fully qualified container name, e.g. `DB_1_NAME=/myapp_web_1/myapp_db_1`
2014-01-27 16:03:21 +01:00
[Docker links]: http://docs.docker.io/en/latest/use/port_redirection/#linking-a-container