1.create介绍
Docker网络命令create是用来新创建Docker网络,如果不指定,默认创建driver为bridge的网络
2.create用法
docker network create [参数] network
[root@centos79 ~]# docker network create --help
Usage: docker network create [OPTIONS] NETWORK
Create a network
Options:
--attachable Enable manual container attachment
--aux-address map Auxiliary IPv4 or IPv6 addresses used by Network driver (default map[])
--config-from string The network from which to copy the configuration
--config-only Create a configuration only network
-d, --driver string Driver to manage the Network (default "bridge")
--gateway strings IPv4 or IPv6 Gateway for the master subnet
--ingress Create swarm routing-mesh network
--internal Restrict external access to the network
--ip-range strings Allocate container ip from a sub-range
--ipam-driver string IP Address Management Driver (default "default")
--ipam-opt map Set IPAM driver specific options (default map[])
--ipv6 Enable IPv6 networking
--label list Set metadata on a network
-o, --opt map Set driver specific options (default map[])
--scope string Control the network's scope
--subnet strings Subnet in CIDR format that represents a network segment
[root@centos79 ~]#
3.create样例
3.1.新建network网络
命令:
docker network create ztj
[root@centos79 ~]# docker network create ztj
5a60f0af41f4c9f6e8e689590bece14d01099841f2b0b519fb30d0efb5a83b3a
[root@centos79 ~]# docker network ls | grep ztj
5a60f0af41f4 ztj bridge local
[root@centos79 ~]#