v1

latestSwagger 2.02026-07-17107130444.8 KB
Network

Connect a container to a network

The network must be either a local-scoped network or a swarm-scoped network with the attachable option set. A network cannot be re-attached to a running container

post/networks/{id}/connect

Path parameters

idstring required

Network ID or name

Request body

Containerstring

The ID or name of the container to connect to the network.

Example request

{
  "Container": "3613f73ba0e4",
  "EndpointConfig": {
    "IPAMConfig": {
      "IPv4Address": "172.24.56.89",
      "IPv6Address": "2001:db8::5689"
    },
    "MacAddress": "02:42:ac:12:05:02",
    "Priority": 100
  }
}

Response

No error