1DOCKER(1)                          OCT 2015                          DOCKER(1)
2
3
4

NAME

6       docker-network-ls - list networks
7
8
9

SYNOPSIS

11       docker network ls [-f|--filter[=[]]] [--format="TEMPLATE"]
12       [--no-trunc[=true|false]] [-q|--quiet[=true|false]] [--help]
13
14
15

DESCRIPTION

17       Lists all the networks the Engine daemon knows about. This includes the
18       networks that span across multiple hosts in a cluster, for example:
19
20
21                  $ docker network ls
22                  NETWORK ID          NAME                DRIVER          SCOPE
23                  7fca4eb8c647        bridge              bridge          local
24                  9f904ee27bf5        none                null            local
25                  cf03ee007fb4        host                host            local
26                  78b03ee04fc4        multi-host          overlay         swarm
27
28
29
30       Use the --no-trunc option to display the full network id:
31
32
33              $ docker network ls --no-trunc
34              NETWORK ID                                                         NAME                DRIVER
35              18a2866682b85619a026c81b98a5e375bd33e1b0936a26cc497c283d27bae9b3   none                null
36              c288470c46f6c8949c5f7e5099b5b7947b07eabe8d9a27d79a9cbf111adcbf47   host                host
37              7b369448dccbf865d397c8d2be0cda7cf7edc6b0945f77d2529912ae917a0185   bridge              bridge
38              95e74588f40db048e86320c6526440c504650a1ff3e9f7d60a497c4d2163e5bd   foo                 bridge
39              63d1ff1f77b07ca51070a8c227e962238358bd310bde1529cf62e6c307ade161   dev                 bridge
40
41
42

Filtering

44       The filtering flag (-f or --filter) format is a key=value pair. If
45       there is more than one filter, then pass multiple flags (e.g. --filter
46       "foo=bar" --filter "bif=baz").  Multiple filter flags are combined as
47       an OR filter. For example, -f type=custom -f type=builtin returns both
48       custom and builtin networks.
49
50
51       The currently supported filters are:
52
53
54              · driver
55
56              · id (network's id)
57
58              · label (label=<key> or label=<key>=<value>)
59
60              · name (network's name)
61
62              · type (custom|builtin)
63
64
65
66   Driver
67       The driver filter matches networks based on their driver.
68
69
70       The following example matches networks with the bridge driver:
71
72
73              $ docker network ls --filter driver=bridge
74              NETWORK ID          NAME                DRIVER
75              db9db329f835        test1               bridge
76              f6e212da9dfd        test2               bridge
77
78
79
80   ID
81       The id filter matches on all or part of a network's ID.
82
83
84       The following filter matches all networks with an ID containing the
85       63d1ff1f77b0... string.
86
87
88              $ docker network ls --filter id=63d1ff1f77b07ca51070a8c227e962238358bd310bde1529cf62e6c307ade161
89              NETWORK ID          NAME                DRIVER
90              63d1ff1f77b0        dev                 bridge
91
92
93
94       You can also filter for a substring in an ID as this shows:
95
96
97              $ docker network ls --filter id=95e74588f40d
98              NETWORK ID          NAME                DRIVER
99              95e74588f40d        foo                 bridge
100
101              $ docker network ls --filter id=95e
102              NETWORK ID          NAME                DRIVER
103              95e74588f40d        foo                 bridge
104
105
106
107   Label
108       The label filter matches networks based on the presence of a label
109       alone or a label and a value.
110
111
112       The following filter matches networks with the usage label regardless
113       of its value.
114
115
116              $ docker network ls -f "label=usage"
117              NETWORK ID          NAME                DRIVER
118              db9db329f835        test1               bridge
119              f6e212da9dfd        test2               bridge
120
121
122
123       The following filter matches networks with the usage label with the
124       prod value.
125
126
127              $ docker network ls -f "label=usage=prod"
128              NETWORK ID          NAME                DRIVER
129              f6e212da9dfd        test2               bridge
130
131
132
133   Name
134       The name filter matches on all or part of a network's name.
135
136
137       The following filter matches all networks with a name containing the
138       foobar string.
139
140
141              $ docker network ls --filter name=foobar
142              NETWORK ID          NAME                DRIVER
143              06e7eef0a170        foobar              bridge
144
145
146
147       You can also filter for a substring in a name as this shows:
148
149
150              $ docker network ls --filter name=foo
151              NETWORK ID          NAME                DRIVER
152              95e74588f40d        foo                 bridge
153              06e7eef0a170        foobar              bridge
154
155
156
157   Type
158       The type filter supports two values; builtin displays predefined
159       networks (bridge, none, host), whereas custom displays user defined
160       networks.
161
162
163       The following filter matches all user defined networks:
164
165
166              $ docker network ls --filter type=custom
167              NETWORK ID          NAME                DRIVER
168              95e74588f40d        foo                 bridge
169              63d1ff1f77b0        dev                 bridge
170
171
172
173       By having this flag it allows for batch cleanup. For example, use this
174       filter to delete all user defined networks:
175
176
177              $ docker network rm `docker network ls --filter type=custom -q`
178
179
180
181       A warning will be issued when trying to remove a network that has
182       containers attached.
183
184
185

OPTIONS

187       -f, --filter=[]
188         filter output based on conditions provided.
189
190
191       --format="TEMPLATE"
192         Pretty-print networks using a Go template.
193         Valid placeholders:
194            .ID - Network ID
195            .Name - Network name
196            .Driver - Network driver
197            .Scope - Network scope (local, global)
198            .IPv6 - Whether IPv6 is enabled on the network or not
199            .Internal - Whether the network is internal or not
200            .Labels - All labels assigned to the network
201            .Label - Value of a specific label for this network. For example
202       {{.Label "project.version"}}
203
204
205       --no-trunc=true|false
206         Do not truncate the output
207
208
209       -q, --quiet=true|false
210         Only display network IDs
211
212
213       --help
214         Print usage statement
215
216
217

HISTORY

219       OCT 2015, created by Mary Anthony ⟨mary@docker.com⟩
220
221
222
223Docker Community              Docker User Manuals                    DOCKER(1)
Impressum