github.com/vincentwoo/docker@v0.7.3-0.20160116130405-82401a4b13c0/man/docker-network-inspect.1.md (about)

     1  % DOCKER(1) Docker User Manuals
     2  % Docker Community
     3  % OCT 2015
     4  # NAME
     5  docker-network-inspect - inspect a network
     6  
     7  # SYNOPSIS
     8  **docker network inspect**
     9  [**-f**|**--format**[=*FORMAT*]]
    10  [**--help**]
    11  NETWORK [NETWORK...]
    12  
    13  # DESCRIPTION
    14  
    15  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 the default `bridge` network:
    16  
    17  ```bash
    18  $ sudo docker run -itd --name=container1 busybox
    19  f2870c98fd504370fb86e59f32cd0753b1ac9b69b7d80566ffc7192a82b3ed27
    20  
    21  $ sudo docker run -itd --name=container2 busybox
    22  bda12f8922785d1f160be70736f26c1e331ab8aaf8ed8d56728508f2e2fd4727
    23  ```
    24  
    25  The `network inspect` command shows the containers, by id, in its
    26  results. You can specify an alternate format to execute a given
    27  template for each result. Go's
    28  [text/template](http://golang.org/pkg/text/template/) package
    29  describes all the details of the format.
    30  
    31  ```bash
    32  $ sudo docker network inspect bridge
    33  [
    34      {
    35          "Name": "bridge",
    36          "Id": "b2b1a2cba717161d984383fd68218cf70bbbd17d328496885f7c921333228b0f",
    37          "Scope": "local",
    38          "Driver": "bridge",
    39          "IPAM": {
    40              "Driver": "default",
    41              "Config": [
    42                  {
    43                      "Subnet": "172.17.42.1/16",
    44                      "Gateway": "172.17.42.1"
    45                  }
    46              ]
    47          },
    48          "Containers": {
    49              "bda12f8922785d1f160be70736f26c1e331ab8aaf8ed8d56728508f2e2fd4727": {
    50                  "Name": "container2",
    51                  "EndpointID": "0aebb8fcd2b282abe1365979536f21ee4ceaf3ed56177c628eae9f706e00e019",
    52                  "MacAddress": "02:42:ac:11:00:02",
    53                  "IPv4Address": "172.17.0.2/16",
    54                  "IPv6Address": ""
    55              },
    56              "f2870c98fd504370fb86e59f32cd0753b1ac9b69b7d80566ffc7192a82b3ed27": {
    57                  "Name": "container1",
    58                  "EndpointID": "a00676d9c91a96bbe5bcfb34f705387a33d7cc365bac1a29e4e9728df92d10ad",
    59                  "MacAddress": "02:42:ac:11:00:01",
    60                  "IPv4Address": "172.17.0.1/16",
    61                  "IPv6Address": ""
    62              }
    63          },
    64          "Options": {
    65              "com.docker.network.bridge.default_bridge": "true",
    66              "com.docker.network.bridge.enable_icc": "true",
    67              "com.docker.network.bridge.enable_ip_masquerade": "true",
    68              "com.docker.network.bridge.host_binding_ipv4": "0.0.0.0",
    69              "com.docker.network.bridge.name": "docker0",
    70              "com.docker.network.driver.mtu": "1500"
    71          }
    72      }
    73  ]
    74  ```
    75  
    76  Returns the information about the user-defined network:
    77  
    78  ```bash
    79  $ docker network create simple-network
    80  69568e6336d8c96bbf57869030919f7c69524f71183b44d80948bd3927c87f6a
    81  $ docker network inspect simple-network
    82  [
    83      {
    84          "Name": "simple-network",
    85          "Id": "69568e6336d8c96bbf57869030919f7c69524f71183b44d80948bd3927c87f6a",
    86          "Scope": "local",
    87          "Driver": "bridge",
    88          "IPAM": {
    89              "Driver": "default",
    90              "Config": [
    91                  {
    92                      "Subnet": "172.22.0.0/16",
    93                      "Gateway": "172.22.0.1/16"
    94                  }
    95              ]
    96          },
    97          "Containers": {},
    98          "Options": {}
    99      }
   100  ]
   101  ```
   102  
   103  # OPTIONS
   104  **-f**, **--format**=""
   105    Format the output using the given go template.
   106  
   107  **--help**
   108    Print usage statement
   109  
   110  # HISTORY
   111  OCT 2015, created by Mary Anthony <mary@docker.com>