1.prune介绍
Docker网络命令prune是用来删除所有无用的网络
2.prune用法
docker network prune [参数]
[root@centos79 ~]# docker network prune --helpUsage: docker network prune [OPTIONS]Remove all unused networksOptions:--filter filter Provide filter values (e.g. "until=<timestamp>")-f, --force Do not prompt for confirmation
[root@centos79 ~]#
3.prune样例
3.1.删除所有无用的网络
命令:
docker network prune
[root@centos79 ~]# docker network ls
NETWORK ID NAME DRIVER SCOPE
6fe1398a5652 bridge bridge local
806f281c40a3 elk bridge local
6dfaabaf6333 host host local
e33f2e7fe685 mynet1 bridge local
8a8734a4776a none null local
[root@centos79 ~]# docker network prune
WARNING! This will remove all custom networks not used by at least one container.
Are you sure you want to continue? [y/N] y
Deleted Networks:
elk
mynet1[root@centos79 ~]# docker network ls
NETWORK ID NAME DRIVER SCOPE
6fe1398a5652 bridge bridge local
6dfaabaf6333 host host local
8a8734a4776a none null local
[root@centos79 ~]#