You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**Note:** Environment variables are no longer the recommended method for connecting to linked services. Instead, you should use the link name (by default, <b><i>name</i>_1</b>) as the hostname to connect to. See the [fig.yml documentation](yml.html#links) for details.
9
+
**Note:** 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 [fig.yml documentation](yml.html#links) for details.
10
10
11
11
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.
12
12
13
13
To see what environment variables are available to a service, run `fig run SERVICE env`.
Link to containers in another service. Optionally specify an alternate name for the link, which will determine how environment variables are prefixed, e.g. `db` -> `DB_1_PORT`, `db:database` -> `DATABASE_PORT`
42
+
Link to containers in another service. Either specify both the service name and the link alias (`SERVICE:ALIAS`), or just the service name (which will also be used for the alias).
43
43
44
44
```
45
45
links:
@@ -51,9 +51,9 @@ links:
51
51
An entry with the alias' name will be created in `/etc/hosts` inside containers for this service, e.g:
52
52
53
53
```
54
-
172.17.2.186 db_1
54
+
172.17.2.186 db
55
55
172.17.2.186 database
56
-
172.17.2.187 redis_1
56
+
172.17.2.187 redis
57
57
```
58
58
59
59
Environment variables will also be created - see the [environment variable reference](env.html) for details.
0 commit comments