network_create
Create a Docker network (bridge or overlay) to interconnect containers. Configure driver, IPAM, labels, and scope for your networking needs.
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 are stamped with provenance labels
(find them later via network_list(managed_only=True)).
args:
name - The name of the network
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", ...}]})
check_duplicate - Reject creation if a duplicate name exists (deprecated: recent daemons always check)
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: "local", "global", or "swarm"
ingress - Make this an ingress network for swarm routing-mesh
returns: dict - The created network's attrs (Id, Name, Driver, Scope, IPAM)
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 | ||
| check_duplicate | No |