network_create
Create a Docker network with specified driver, IPAM, and options, returns the network's full inspect payload. Use to establish isolated or swarm-wide connectivity before attaching containers.
Instructions
Create a network.
The daemon default driver is bridge (single-host); use overlay for swarm-wide networks.
Creating a network attaches nothing - connect containers afterwards with network_connect or
at start via container_run(network=...). Created networks carry provenance labels.
A duplicate name is always rejected,
so creating is not idempotent - check network_list first when the network may already exist.
Args:
driver: Driver name (daemon default bridge; overlay for swarm scope)
options: Driver-specific options dict
ipam: IPAM configuration as a dict (engine shape: {"Driver", "Config": [{"Subnet", "Gateway", ...}]})
internal: Restrict external access
labels: Labels to set on the network
enable_ipv6: Enable IPv6 networking
attachable: Allow standalone containers to attach (swarm overlay networks)
scope: Network scope; the driver picks a sensible default when omitted
ingress: Make this an ingress network for swarm routing-mesh
Returns: dict: The created network's full inspect payload
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ipam | No | ||
| name | Yes | ||
| scope | No | ||
| driver | No | ||
| labels | No | ||
| ingress | No | ||
| options | No | ||
| internal | No | ||
| attachable | No | ||
| enable_ipv6 | No |