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
5 changes: 3 additions & 2 deletions content/network/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,9 @@ A container receives an IP address out of the IP subnet of the network.
The Docker daemon performs dynamic subnetting and IP address allocation for containers.
Each network also has a default subnet mask and gateway.

When a container starts, it can only attach to a single network, using the `--network` flag.
You can connect a running container to additional networks using the `docker network connect` command.
You can connect a running container to multiple networks,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it'd be valuable to detail how the advanced --network format can be used to attach to multiple networks. I think the doc doesn't mention that right now. Here's the relevant PRs:

I think it might worth also mentioning how the CLI interprets top-level flags when multiple networks are specified.

either by passing the `--network` flag multiple times when creating the container,
or using the `docker network connect` command for already running containers.
In both cases, you can use the `--ip` or `--ip6` flags to specify the container's IP address on that particular network.

In the same way, a container's hostname defaults to be the container's ID in Docker.
Expand Down