Skip to content

List all networks in a docker setup

To list down all networks that a docker daemon know about, we can used docker network ls command.

Advertisements
> sudo docker network ls
NETWORK ID          NAME                  DRIVER              SCOPE
9d7cdf93dc36        bridge                bridge              local
b6cdfd5c05db        host                  host                local
2ab9a67af69b        none                  null                local
775c2de3694e        poopcode-network-qa   bridge              local

We can filter the network using the filter argument.

> sudo docker network ls --filter driver=bridge
NETWORK ID          NAME                  DRIVER              SCOPE
9d7cdf93dc36        bridge                bridge              local
775c2de3694e        poopcode-network-qa   bridge              local
> sudo docker network ls --filter id=775c2de3694e
NETWORK ID          NAME                DRIVER              SCOPE
775c2de3694e        poopcode-network-qa   bridge              local
Advertisements

We can format the result using the following format.

> sudo docker network ls --format "{{.ID}}-{{.Name}}-{{.Driver}}"
9d7c3f93dc36-bridge-bridge
b6cdad5c05db-host-host
2ab9a67af69b-none-null
775c2de3694e-poopcode-network-qa-bridge

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.