.nh .TH "DOCKER" "1" "May 2022" "Docker Community" "Docker User Manuals" .SH NAME .PP docker\-network\-ls \- List networks .SH SYNOPSIS .PP \fBdocker network ls [OPTIONS]\fP .SH DESCRIPTION .PP Lists all the networks the Engine \fB\fCdaemon\fR knows about. This includes the networks that span across multiple hosts in a cluster, for example: .PP .RS .nf $ docker network ls NETWORK ID NAME DRIVER SCOPE 7fca4eb8c647 bridge bridge local 9f904ee27bf5 none null local cf03ee007fb4 host host local 78b03ee04fc4 multi\-host overlay swarm .fi .RE .PP Use the \fB\fC\-\-no\-trunc\fR option to display the full network id: .PP .RS .nf $ docker network ls \-\-no\-trunc NETWORK ID NAME DRIVER 18a2866682b85619a026c81b98a5e375bd33e1b0936a26cc497c283d27bae9b3 none null c288470c46f6c8949c5f7e5099b5b7947b07eabe8d9a27d79a9cbf111adcbf47 host host 7b369448dccbf865d397c8d2be0cda7cf7edc6b0945f77d2529912ae917a0185 bridge bridge 95e74588f40db048e86320c6526440c504650a1ff3e9f7d60a497c4d2163e5bd foo bridge 63d1ff1f77b07ca51070a8c227e962238358bd310bde1529cf62e6c307ade161 dev bridge .fi .RE .SH Filtering .PP The filtering flag (\fB\fC\-f\fR or \fB\fC\-\-filter\fR) format is a \fB\fCkey=value\fR pair. If there is more than one filter, then pass multiple flags (e.g. \fB\fC\-\-filter "foo=bar" \-\-filter "bif=baz"\fR). Multiple filter flags are combined as an \fB\fCOR\fR filter. For example, \fB\fC\-f type=custom \-f type=builtin\fR returns both \fB\fCcustom\fR and \fB\fCbuiltin\fR networks. .PP The currently supported filters are: .RS .IP \(bu 2 driver .IP \(bu 2 id (network's id) .IP \(bu 2 label (\fB\fClabel=\fR or \fB\fClabel==\fR) .IP \(bu 2 name (network's name) .IP \(bu 2 scope (\fB\fCswarm|global|local\fR) .IP \(bu 2 type (custom|builtin) .RE .SS Driver .PP The \fB\fCdriver\fR filter matches networks based on their driver. .PP The following example matches networks with the \fB\fCbridge\fR driver: .PP .RS .nf $ docker network ls \-\-filter driver=bridge NETWORK ID NAME DRIVER db9db329f835 test1 bridge f6e212da9dfd test2 bridge .fi .RE .SS ID .PP The \fB\fCid\fR filter matches on all or part of a network's ID. .PP The following filter matches all networks with an ID containing the \fB\fC63d1ff1f77b0...\fR string. .PP .RS .nf $ docker network ls \-\-filter id=63d1ff1f77b07ca51070a8c227e962238358bd310bde1529cf62e6c307ade161 NETWORK ID NAME DRIVER 63d1ff1f77b0 dev bridge .fi .RE .PP You can also filter for a substring in an ID as this shows: .PP .RS .nf $ docker network ls \-\-filter id=95e74588f40d NETWORK ID NAME DRIVER 95e74588f40d foo bridge $ docker network ls \-\-filter id=95e NETWORK ID NAME DRIVER 95e74588f40d foo bridge .fi .RE .SS Label .PP The \fB\fClabel\fR filter matches networks based on the presence of a \fB\fClabel\fR alone or a \fB\fClabel\fR and a value. .PP The following filter matches networks with the \fB\fCusage\fR label regardless of its value. .PP .RS .nf $ docker network ls \-f "label=usage" NETWORK ID NAME DRIVER db9db329f835 test1 bridge f6e212da9dfd test2 bridge .fi .RE .PP The following filter matches networks with the \fB\fCusage\fR label with the \fB\fCprod\fR value. .PP .RS .nf $ docker network ls \-f "label=usage=prod" NETWORK ID NAME DRIVER f6e212da9dfd test2 bridge .fi .RE .SS Name .PP The \fB\fCname\fR filter matches on all or part of a network's name. .PP The following filter matches all networks with a name containing the \fB\fCfoobar\fR string. .PP .RS .nf $ docker network ls \-\-filter name=foobar NETWORK ID NAME DRIVER 06e7eef0a170 foobar bridge .fi .RE .PP You can also filter for a substring in a name as this shows: .PP .RS .nf $ docker network ls \-\-filter name=foo NETWORK ID NAME DRIVER 95e74588f40d foo bridge 06e7eef0a170 foobar bridge .fi .RE .SS Scope .PP The \fB\fCscope\fR filter matches networks based on their scope. .PP The following example matches networks with the \fB\fCswarm\fR scope: .PP .RS .nf $ docker network ls \-\-filter scope=swarm NETWORK ID NAME DRIVER SCOPE xbtm0v4f1lfh ingress overlay swarm ic6r88twuu92 swarmnet overlay swarm .fi .RE .PP The following example matches networks with the \fB\fClocal\fR scope: .PP .RS .nf $ docker network ls \-\-filter scope=local NETWORK ID NAME DRIVER SCOPE e85227439ac7 bridge bridge local 0ca0e19443ed host host local ca13cc149a36 localnet bridge local f9e115d2de35 none null local .fi .RE .SS Type .PP The \fB\fCtype\fR filter supports two values; \fB\fCbuiltin\fR displays predefined networks (\fB\fCbridge\fR, \fB\fCnone\fR, \fB\fChost\fR), whereas \fB\fCcustom\fR displays user defined networks. .PP The following filter matches all user defined networks: .PP .RS .nf $ docker network ls \-\-filter type=custom NETWORK ID NAME DRIVER 95e74588f40d foo bridge 63d1ff1f77b0 dev bridge .fi .RE .PP By having this flag it allows for batch cleanup. For example, use this filter to delete all user defined networks: .PP .RS .nf $ docker network rm `docker network ls \-\-filter type=custom \-q` .fi .RE .PP A warning will be issued when trying to remove a network that has containers attached. .SH Format .PP Format uses a Go template to print the output. The following variables are supported: .RS .IP \(bu 2 \&.ID \-\& Network ID .IP \(bu 2 \&.Name \-\& Network name .IP \(bu 2 \&.Driver \-\& Network driver .IP \(bu 2 \&.Scope \-\& Network scope (local, global) .IP \(bu 2 \&.IPv6 \-\& Whether IPv6 is enabled on the network or not .IP \(bu 2 \&.Internal \-\& Whether the network is internal or not .IP \(bu 2 \&.Labels \-\& All labels assigned to the network .IP \(bu 2 \&.Label \-\& Value of a specific label for this network. For example \fB\fC{{.Label "project.version"}}\fR .RE .SH OPTIONS .PP \fB\-f\fP, \fB\-\-filter\fP= Provide filter values (e.g. 'driver=bridge') .PP \fB\-\-format\fP="" Pretty\-print networks using a Go template .PP \fB\-h\fP, \fB\-\-help\fP[=false] help for ls .PP \fB\-\-no\-trunc\fP[=false] Do not truncate the output .PP \fB\-q\fP, \fB\-\-quiet\fP[=false] Only display network IDs .SH SEE ALSO .PP \fBdocker\-network(1)\fP