Network

Connect a container to a network

Changed on

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

Request

  • Base URL
    /v1.49 (relative, and the document was published on a file host, not at the API’s origin)
  • URL
    /v1.49/networks/{id}/connect
  • Auth
    none declared

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

Changes