components/docker/files/man/docker-network-ls.1
changeset 6468 af5d82385cd7
equal deleted inserted replaced
6467:e5632698211d 6468:af5d82385cd7
       
     1 .TH "DOCKER" "1" " Docker User Manuals" "Docker Community" "OCT 2015"  ""
       
     2 
       
     3 
       
     4 .SH NAME
       
     5 .PP
       
     6 docker\-network\-ls \- list networks
       
     7 
       
     8 
       
     9 .SH SYNOPSIS
       
    10 .PP
       
    11 \fBdocker network ls\fP
       
    12 [\fB\-f\fP|\fB\-\-filter\fP[=\fI[]\fP]]
       
    13 [\fB\-\-no\-trunc\fP[=\fItrue\fP|\fIfalse\fP]]
       
    14 [\fB\-q\fP|\fB\-\-quiet\fP[=\fItrue\fP|\fIfalse\fP]]
       
    15 [\fB\-\-help\fP]
       
    16 
       
    17 
       
    18 .SH DESCRIPTION
       
    19 .PP
       
    20 Lists all the networks the Engine \fB\fCdaemon\fR knows about. This includes the
       
    21 networks that span across multiple hosts in a cluster, for example:
       
    22 
       
    23 .PP
       
    24 .RS
       
    25 
       
    26 .nf
       
    27     $ docker network ls
       
    28     NETWORK ID          NAME                DRIVER
       
    29     7fca4eb8c647        bridge              bridge
       
    30     9f904ee27bf5        none                null
       
    31     cf03ee007fb4        host                host
       
    32     78b03ee04fc4        multi\-host          overlay
       
    33 
       
    34 .fi
       
    35 .RE
       
    36 
       
    37 .PP
       
    38 Use the \fB\fC\-\-no\-trunc\fR option to display the full network id:
       
    39 
       
    40 .PP
       
    41 .RS
       
    42 
       
    43 .nf
       
    44 $ docker network ls \-\-no\-trunc
       
    45 NETWORK ID                                                         NAME                DRIVER
       
    46 18a2866682b85619a026c81b98a5e375bd33e1b0936a26cc497c283d27bae9b3   none                null                
       
    47 c288470c46f6c8949c5f7e5099b5b7947b07eabe8d9a27d79a9cbf111adcbf47   host                host                
       
    48 7b369448dccbf865d397c8d2be0cda7cf7edc6b0945f77d2529912ae917a0185   bridge              bridge              
       
    49 95e74588f40db048e86320c6526440c504650a1ff3e9f7d60a497c4d2163e5bd   foo                 bridge    
       
    50 63d1ff1f77b07ca51070a8c227e962238358bd310bde1529cf62e6c307ade161   dev                 bridge
       
    51 
       
    52 .fi
       
    53 .RE
       
    54 
       
    55 .SH Filtering
       
    56 .PP
       
    57 The filtering flag (\fB\fC\-f\fR or \fB\fC\-\-filter\fR) format is a \fB\fCkey=value\fR pair. If there
       
    58 is more than one filter, then pass multiple flags (e.g. \fB\fC\-\-filter "foo=bar" \-\-filter "bif=baz"\fR).
       
    59 Multiple filter flags are combined as an \fB\fCOR\fR filter. For example,
       
    60 \fB\fC\-f type=custom \-f type=builtin\fR returns both \fB\fCcustom\fR and \fB\fCbuiltin\fR networks.
       
    61 
       
    62 .PP
       
    63 The currently supported filters are:
       
    64 .IP \n+[step]
       
    65 
       
    66 \item id (network's id)
       
    67 \item name (network's name)
       
    68 \item type (custom|builtin)
       
    69 .SS Type
       
    70 .PP
       
    71 The \fB\fCtype\fR filter supports two values; \fB\fCbuiltin\fR displays predefined networks
       
    72 (\fB\fCbridge\fR, \fB\fCnone\fR, \fB\fChost\fR), whereas \fB\fCcustom\fR displays user defined networks.
       
    73 
       
    74 .PP
       
    75 The following filter matches all user defined networks:
       
    76 
       
    77 .PP
       
    78 .RS
       
    79 
       
    80 .nf
       
    81 $ docker network ls \-\-filter type=custom
       
    82 NETWORK ID          NAME                DRIVER
       
    83 95e74588f40d        foo                 bridge
       
    84 63d1ff1f77b0        dev                 bridge
       
    85 
       
    86 .fi
       
    87 .RE
       
    88 
       
    89 .PP
       
    90 By having this flag it allows for batch cleanup. For example, use this filter
       
    91 to delete all user defined networks:
       
    92 
       
    93 .PP
       
    94 .RS
       
    95 
       
    96 .nf
       
    97 $ docker network rm `docker network ls \-\-filter type=custom \-q`
       
    98 
       
    99 .fi
       
   100 .RE
       
   101 
       
   102 .PP
       
   103 A warning will be issued when trying to remove a network that has containers
       
   104 attached.
       
   105 
       
   106 .SS Name
       
   107 .PP
       
   108 The \fB\fCname\fR filter matches on all or part of a network's name.
       
   109 
       
   110 .PP
       
   111 The following filter matches all networks with a name containing the \fB\fCfoobar\fR string.
       
   112 
       
   113 .PP
       
   114 .RS
       
   115 
       
   116 .nf
       
   117 $ docker network ls \-\-filter name=foobar
       
   118 NETWORK ID          NAME                DRIVER
       
   119 06e7eef0a170        foobar              bridge
       
   120 
       
   121 .fi
       
   122 .RE
       
   123 
       
   124 .PP
       
   125 You can also filter for a substring in a name as this shows:
       
   126 
       
   127 .PP
       
   128 .RS
       
   129 
       
   130 .nf
       
   131 $ docker ps \-\-filter name=foo
       
   132 NETWORK ID          NAME                DRIVER
       
   133 95e74588f40d        foo                 bridge
       
   134 06e7eef0a170        foobar              bridge
       
   135 
       
   136 .fi
       
   137 .RE
       
   138 
       
   139 .SS ID
       
   140 .PP
       
   141 The \fB\fCid\fR filter matches on all or part of a network's ID.
       
   142 
       
   143 .PP
       
   144 The following filter matches all networks with a name containing the
       
   145 \fB\fC06e7eef01700\fR string.
       
   146 
       
   147 .PP
       
   148 .RS
       
   149 
       
   150 .nf
       
   151 $ docker network ls \-\-filter id=63d1ff1f77b07ca51070a8c227e962238358bd310bde1529cf62e6c307ade161
       
   152 NETWORK ID          NAME                DRIVER
       
   153 63d1ff1f77b0        dev                 bridge
       
   154 
       
   155 .fi
       
   156 .RE
       
   157 
       
   158 .PP
       
   159 You can also filter for a substring in a ID as this shows:
       
   160 
       
   161 .PP
       
   162 .RS
       
   163 
       
   164 .nf
       
   165 $ docker ps \-\-filter id=95e74588f40d
       
   166 NETWORK ID          NAME                DRIVER
       
   167 95e74588f40d        foo                 bridge
       
   168 
       
   169 $ docker ps \-\-filter id=95e
       
   170 NETWORK ID          NAME                DRIVER
       
   171 95e74588f40d        foo                 bridge
       
   172 
       
   173 .fi
       
   174 .RE
       
   175 
       
   176 
       
   177 .SH OPTIONS
       
   178 .PP
       
   179 \fB\-f\fP, \fB\-\-filter\fP=\fI[]\fP
       
   180   filter output based on conditions provided.
       
   181 
       
   182 .PP
       
   183 \fB\-\-no\-trunc\fP=\fItrue\fP|\fIfalse\fP
       
   184   Do not truncate the output
       
   185 
       
   186 .PP
       
   187 \fB\-q\fP, \fB\-\-quiet\fP=\fItrue\fP|\fIfalse\fP
       
   188   Only display numeric IDs
       
   189 
       
   190 .PP
       
   191 \fB\-\-help\fP
       
   192   Print usage statement
       
   193 
       
   194 
       
   195 .SH HISTORY
       
   196 .PP
       
   197 OCT 2015, created by Mary Anthony 
       
   198 \[la][email protected]\[ra]