mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
295c27388d
…for consistency as docker inspect and docker volume inspect supports it too Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2.2 KiB
2.2 KiB
network inspect
Usage: docker network inspect [OPTIONS] NETWORK [NETWORK..]
Displays detailed information on a network
-f, --format= Format the output using the given go template.
--help=false Print usage
Returns information about one or more networks. By default, this command renders all results in a JSON object. For example, if you connect two containers to a network:
$ sudo docker run -itd --name=container1 busybox
f2870c98fd504370fb86e59f32cd0753b1ac9b69b7d80566ffc7192a82b3ed27
$ sudo docker run -itd --name=container2 busybox
bda12f8922785d1f160be70736f26c1e331ab8aaf8ed8d56728508f2e2fd4727
The network inspect
command shows the containers, by id, in its
results. You can specify an alternate format to execute a given
template for each result. Go's
text/template package describes all the
details of the format.
$ sudo docker network inspect bridge
[
{
"name": "bridge",
"id": "7fca4eb8c647e57e9d46c32714271e0c3f8bf8d17d346629e2820547b2d90039",
"driver": "bridge",
"containers": {
"bda12f8922785d1f160be70736f26c1e331ab8aaf8ed8d56728508f2e2fd4727": {
"endpoint": "e0ac95934f803d7e36384a2029b8d1eeb56cb88727aa2e8b7edfeebaa6dfd758",
"mac_address": "02:42:ac:11:00:03",
"ipv4_address": "172.17.0.3/16",
"ipv6_address": ""
},
"f2870c98fd504370fb86e59f32cd0753b1ac9b69b7d80566ffc7192a82b3ed27": {
"endpoint": "31de280881d2a774345bbfb1594159ade4ae4024ebfb1320cb74a30225f6a8ae",
"mac_address": "02:42:ac:11:00:02",
"ipv4_address": "172.17.0.2/16",
"ipv6_address": ""
}
}
}
]