09-06-2023, 10:32 AM
How to Remove Docker Networks?
Though Docker networks don’t take much disk space, it can cause some problems if unnecessary files are not cleared from the disk.
One problem is that it creates rules for iptables and bridge networks with routing table entries, which can cause some issues in the long run.
For a full list of NETWORK IDs, use the following command:
docker network ls
In order to remove a specific network, you can use:
docker network rm NETWORK_ID
If you wish to remove all unused networks, use the following command:
docker network prune
For a filter based on the time frame, 24 hours in this example, you can simply enter instead:
docker network prune --filter "until=24h"

