Files
docker-docs/compose/link-env-deprecated.md
Sebastiaan van Stijn 331554f4b3 Fix various links that were generating URLs with .md (#10548)
* Fix incorrect links in compose section

there's a bug causing wrapped links to not work, and replacing
some links to point to the .md file, so that IDE's can check
if the anchors are valid. Also replaced some links to point
to their new location.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>

* engine/swarm: update links

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>

* Fix various broken links

There's a bug in the "jekyll-relative-links" plugin that causes wrapped links to not work.
Also replacing some links to point to the .md file, so that IDE's can check if the anchors
are valid. Finally, replaced some links to point to their new locations, so that users don't
get redirected..

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-04-01 12:05:50 +01:00

1.8 KiB

description, keywords, redirect_from, title, notoc
description keywords redirect_from title notoc
Compose CLI reference fig, composition, compose, docker, orchestration, cli, reference
/compose/env
Link environment variables (superseded) true

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 docker-compose.yml documentation for details.

Environment variables are only populated if you're using the legacy version 1 Compose file format.

Compose 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.

To see what environment variables are available to a service, run docker-compose run SERVICE env.

name_PORT
Full URL, such as DB_PORT=tcp://172.17.0.5:5432

name_PORT_num_protocol
Full URL, such as DB_PORT_5432_TCP=tcp://172.17.0.5:5432

name_PORT_num_protocol_ADDR
Container's IP address, such as DB_PORT_5432_TCP_ADDR=172.17.0.5

name_PORT_num_protocol_PORT
Exposed port number, such as DB_PORT_5432_TCP_PORT=5432

name_PORT_num_protocol_PROTO
Protocol (tcp or udp), such as DB_PORT_5432_TCP_PROTO=tcp

name_NAME
Fully qualified container name, such as DB_1_NAME=/myapp_web_1/myapp_db_1