connect_network
Attach a running container to an additional network without restarting it. Assign DNS aliases or static IPs for network access.
Instructions
Attach a running container to an additional network without restarting it.
Use this to give a container access to services on a network it was not started with.
aliases sets extra DNS names for this container within the network (other containers
can reach it by those names in addition to its container name). ipv4_address /
ipv6_address assign a specific IP on the network; omit to let the driver assign one.
links is a legacy feature (deprecated; prefer DNS aliases). Use disconnect_network
to undo.
args: network_id - Network id or name to connect the container to container - Container id or name to attach aliases - Additional DNS names for this container within the network links - Legacy container links (deprecated) ipv4_address - Static IPv4 address to assign on this network ipv6_address - Static IPv6 address to assign on this network link_local_ips - Link-local IP addresses to assign driver_opt - Driver-specific endpoint options returns: bool - True after the container is connected
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| links | No | ||
| aliases | No | ||
| container | Yes | ||
| driver_opt | No | ||
| network_id | Yes | ||
| ipv4_address | No | ||
| ipv6_address | No | ||
| link_local_ips | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |