docker-network-create

NAME
       docker-network-create - Create a network

SYNOPSIS
       docker network create [OPTIONS] NETWORK
 

 $ docker network create -d bridge --subnet=192.168.0.0/16 br0
 $ docker network create \
                --driver=bridge \
                --subnet=172.28.0.0/16 \
                --ip-range=172.28.5.0/24 \
                --gateway=172.28.5.254 \
                br0
 $ docker network create -d overlay \
                --subnet=192.168.0.0/16 \
                --subnet=192.170.0.0/16 \
                --gateway=192.168.0.100 \
                --gateway=192.170.0.100 \
                --ip-range=192.168.1.0/24 \
                --aux-address="my-router=192.168.1.5" --aux-address="my-switch=192.168.1.6" \
                --aux-address="my-printer=192.170.1.5" --aux-address="my-nas=192.170.1.6" \
                my-multihost-network

 Network ingress mode
       You can create the network which will be used to provide the routing-mesh in the swarm
       cluster. You do so by specifying --ingress when creating the network. Only one ingress network
       can be created at the time. The network can be removed only if no services depend on it. Any
       option available when creating an overlay network is also available when creating the ingress
       network, besides the --attachable option.

              $ docker network create -d overlay \
                --subnet=10.11.0.0/16 \
                --ingress \
                --opt com.docker.network.mtu=9216 \
                --opt encrypted=true \
                my-ingress-network

   Run services on predefined networks
       You can create services on the predefined docker networks bridge and host.

              $ docker service create --name my-service \
                --network host \
                --replicas 2 \
                busybox top
 

           

OPTIONS
       --attachable[=false]
           Enable manual container attachment

       --aux-address=map[]
           Auxiliary IPv4 or IPv6 addresses used by Network driver

       --config-from=""
           The network from which copying the configuration

       --config-only[=false]
           Create a configuration only network

       -d, --driver="bridge"
           Driver to manage the Network

       --gateway=[]
           IPv4 or IPv6 Gateway for the master subnet

       -h, --help[=false]
           help for create

       --ingress[=false]
           Create swarm routing-mesh network

       --internal[=false]
           Restrict external access to the network

       --ip-range=[]
           Allocate container ip from a sub-range

       --ipam-driver="default"
           IP Address Management Driver

       --ipam-opt=map[]
           Set IPAM driver specific options

       --ipv6[=false]
           Enable IPv6 networking

       --label=
           Set metadata on a network

       -o, --opt=map[]
           Set driver specific options

       --scope=""
           Control the network's scope

       --subnet=[]
           Subnet in CIDR format that represents a network segment

SEE ALSO
       docker-network(1)
 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值