This commit is contained in:
Aanand Prasad 2014-10-16 19:13:06 +01:00
commit f9b733a718
8 changed files with 95 additions and 51 deletions

View file

@ -6,7 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href='http://fonts.googleapis.com/css?family=Lilita+One|Lato:300,400,700' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="css/fig.css?20140808310756672680036">
<link rel="stylesheet" type="text/css" href="css/fig.css?20141016411875515447359">
<link rel="canonical" href="http://www.fig.sh/env.html">
</head>
<body>
@ -20,24 +20,26 @@
<div class="content"><h1>Environment variables reference</h1>
<p>Fig uses <a href="http://docs.docker.io/en/latest/use/port_redirection/#linking-a-container">Docker links</a> to expose services&#39; containers to one another. Each linked container injects a set of environment variables, each of which begins with the uppercase name of the container.</p>
<p><strong>Note:</strong> Environment variables are no longer the recommended method for connecting to linked services. Instead, you should use the link name (by default, the name of the linked service) as the hostname to connect to. See the <a href="yml.html#links">fig.yml documentation</a> for details.</p>
<p>Fig uses <a href="http://docs.docker.com/userguide/dockerlinks/">Docker links</a> to expose services&#39; containers to one another. Each linked container injects a set of environment variables, each of which begins with the uppercase name of the container.</p>
<p>To see what environment variables are available to a service, run <code>fig run SERVICE env</code>.</p>
<p><b><i>name</i>_PORT</b><br>
Full URL, e.g. <code>DB_1_PORT=tcp://172.17.0.5:5432</code></p>
Full URL, e.g. <code>DB_PORT=tcp://172.17.0.5:5432</code></p>
<p><b><i>name</i>_PORT_<i>num</i>_<i>protocol</i></b><br>
Full URL, e.g. <code>DB_1_PORT_5432_TCP=tcp://172.17.0.5:5432</code></p>
Full URL, e.g. <code>DB_PORT_5432_TCP=tcp://172.17.0.5:5432</code></p>
<p><b><i>name</i>_PORT_<i>num</i>_<i>protocol</i>_ADDR</b><br>
Container&#39;s IP address, e.g. <code>DB_1_PORT_5432_TCP_ADDR=172.17.0.5</code></p>
Container&#39;s IP address, e.g. <code>DB_PORT_5432_TCP_ADDR=172.17.0.5</code></p>
<p><b><i>name</i>_PORT_<i>num</i>_<i>protocol</i>_PORT</b><br>
Exposed port number, e.g. <code>DB_1_PORT_5432_TCP_PORT=5432</code></p>
Exposed port number, e.g. <code>DB_PORT_5432_TCP_PORT=5432</code></p>
<p><b><i>name</i>_PORT_<i>num</i>_<i>protocol</i>_PROTO</b><br>
Protocol (tcp or udp), e.g. <code>DB_1_PORT_5432_TCP_PROTO=tcp</code></p>
Protocol (tcp or udp), e.g. <code>DB_PORT_5432_TCP_PROTO=tcp</code></p>
<p><b><i>name</i>_NAME</b><br>
Fully qualified container name, e.g. <code>DB_1_NAME=/myapp_web_1/myapp_db_1</code></p>