v1
latestSwagger 2.02026-07-175684145.0 KBNetwork
Connect a container to a network
post/networks/{id}/connect
Path parameters
idstring required
Network ID or name
Request body
Example request
{
"EndpointConfig": {
"Links": [
"container_1",
"container_2"
],
"Aliases": [
"server_x",
"server_y"
],
"NetworkID": "08754567f1f40222263eab4102e1c733ae697e8e354aa9cd6e18d7402835292a",
"EndpointID": "b88f5b905aabf2893f3cbc4ee42d1ea7980bbc0a92e2c8922b1e1795298afb0b",
"Gateway": "172.17.0.1",
"IPAddress": "172.17.0.4",
"IPPrefixLen": 16,
"IPv6Gateway": "2001:db8:2::100",
"GlobalIPv6Address": "2001:db8::5689",
"GlobalIPv6PrefixLen": 64,
"MacAddress": "02:42:ac:11:00:04",
"DriverOpts": {
"com.example.some-label": "some-value",
"com.example.some-other-label": "some-other-value"
}
}
}Response
No error