Skip to content

Commit 1ad73ff

Browse files
Add network_mode: bridge to Compose file reference (#24749)
<!--Delete sections as needed --> ## Description Adds documentation for `network_mode: bridge` in the Compose file reference. While `bridge` is a valid and functional network_mode option that connects containers to the host's default bridge network, it was not documented alongside the other options (none, host, service, container). Fixes #24742. - #24742 <!-- Related issues, pull requests, or Jira tickets --> ## Reviews <!-- Notes for reviewers here --> <!-- List applicable reviews (optionally @tag reviewers) --> - [x] Technical review - [ ] Editorial review - [ ] Product review --------- Signed-off-by: Mahitha Adapa <mahitha.ada@gmail.com> Co-authored-by: Allie Sadler <102604716+aevesdocker@users.noreply.github.com>
1 parent 1c05501 commit 1ad73ff

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

content/reference/compose-file/services.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1334,6 +1334,9 @@ If either is omitted, Compose automatically generates the environment variable n
13341334

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

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

13441347
```yml
1348+
network_mode: "bridge"
13451349
network_mode: "host"
13461350
network_mode: "none"
13471351
network_mode: "service:[service name]"

0 commit comments

Comments
 (0)