CentOS 7
Docker 20.10
I want to delete all networks.
docker container ls
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
As you can see no containers. I was removed it before. I try this:
docker network ls
NETWORK ID NAME DRIVER SCOPE
1b6758d38df3 bridge bridge local
89dea066d590 host host local
8e235018309e none null local
And this:
docker network rm 1b6758d38df3
Error response from daemon: bridge is a pre-defined network and cannot be removed
P.S the folder /var/lib/docker
is empty
CodePudding user response:
Those are the system networks included in every Docker installation, they are not like user-defined networks and cannot be removed.
From the docs for thedocker network prune
command:
Note that system networks such as bridge, host, and none will never be pruned
From the Network containers tutorial page:
Every installation of the Docker Engine automatically includes three default networks. [...] The network named bridge is a special network. Unless you tell it otherwise, Docker always launches your containers in this network.
This would mean that removing those networks would break some of Docker's networking features.