In my Network manager I see a great number of Bridge configurations, automatically created during my Lando experiments. Is there a tool, lando or docker command to clean up this mess, only leaving bridge networking of the two projects I am presently developing under Lando?
The command docker network prune
removes all unused networks, but should be used with caution. Note that you can filter networks to remove, according to labels.
If your automatically created networks have labels (for example let's say created=auto
), you can run :
docker network prune \
--filter "label=created=auto"
to remove such networks.
If there is no labels, you can filter by time, for example :
docker network prune \
--filter until=1d
This will remove all networks created more than 1 day ago.