美文网首页
docker network (二):创建网络

docker network (二):创建网络

作者: 许笑山 | 来源:发表于2019-05-27 21:46 被阅读0次

docker network (二):创建网络

docker network create --help

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 copying 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

创建一个其他的网段(docker默认使用172.17.0.1网段),使用如下命令。
docker network create --subnet 172.18.0.1/16 test_NetWork

如果碰到Pool overlaps with other one on this address space错误,可以更改网段试一下。

(其中,172.18.0.1/16中的16表示,子网掩码有16位,即255.255.0.0)

参考:docker API

相关文章

网友评论

      本文标题:docker network (二):创建网络

      本文链接:https://www.haomeiwen.com/subject/xmoktctx.html