Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions content/reference/compose-file/services.md
Original file line number Diff line number Diff line change
Expand Up @@ -1334,6 +1334,9 @@ If either is omitted, Compose automatically generates the environment variable n

`network_mode` sets a service container's network mode.

- `bridge`: Connects the container to Docker's default bridge network instead of
a project-specific network. Containers on the default bridge network cannot
resolve each other by service name . Instead, use a user-defined network for DNS resolution.
- `none`: Turns off all container networking.
- `host`: Gives the container raw access to the host's network interface.
- `service:{name}`: Gives the container access to the specified container by referring to its service name.
Expand All @@ -1342,6 +1345,7 @@ If either is omitted, Compose automatically generates the environment variable n
For more information container networks, see the [Docker Engine documentation](/manuals/engine/network/_index.md#container-networks).

```yml
network_mode: "bridge"
network_mode: "host"
network_mode: "none"
network_mode: "service:[service name]"
Expand Down