[TOC] 创建和查看network 通过`docker network -h`查看命令列表 ``` Commands: connect Connect a container to a network create Create a network disconnect Disconnect a container from a network inspect Display detailed information on one or more networks ls List networks prune Remove all unused networks rm Remove one or more networks ``` 创建:`docker network create --subnet=172.18.0.0/24 pxc-net ` 查看详情:`docket network inspect pxc-net` 删除:`docker network rm pxc-net ` 网络列表:`docker network ls` # 案例 > 指定网络 ## 删除创建网络 ``` docker network rm tomcat-network docker network create tomcat-network ``` ## 启动tomcat容器 ``` docker run --name mytomcat -d --network tomcat-network -p 8080:8080 tomcat:latest ```