github.com/ssdev-go/moby@v17.12.1-ce-rc2+incompatible/cmd/dockerd/config_common_unix.go (about)

     1  // +build linux freebsd
     2  
     3  package main
     4  
     5  import (
     6  	"github.com/docker/docker/api/types"
     7  	"github.com/docker/docker/daemon/config"
     8  	"github.com/docker/docker/opts"
     9  	"github.com/spf13/pflag"
    10  )
    11  
    12  var (
    13  	defaultPidFile  = "/var/run/docker.pid"
    14  	defaultDataRoot = "/var/lib/docker"
    15  	defaultExecRoot = "/var/run/docker"
    16  )
    17  
    18  // installUnixConfigFlags adds command-line options to the top-level flag parser for
    19  // the current process that are common across Unix platforms.
    20  func installUnixConfigFlags(conf *config.Config, flags *pflag.FlagSet) {
    21  	conf.Runtimes = make(map[string]types.Runtime)
    22  
    23  	flags.StringVarP(&conf.SocketGroup, "group", "G", "docker", "Group for the unix socket")
    24  	flags.StringVar(&conf.BridgeConfig.IP, "bip", "", "Specify network bridge IP")
    25  	flags.StringVarP(&conf.BridgeConfig.Iface, "bridge", "b", "", "Attach containers to a network bridge")
    26  	flags.StringVar(&conf.BridgeConfig.FixedCIDR, "fixed-cidr", "", "IPv4 subnet for fixed IPs")
    27  	flags.Var(opts.NewIPOpt(&conf.BridgeConfig.DefaultGatewayIPv4, ""), "default-gateway", "Container default gateway IPv4 address")
    28  	flags.Var(opts.NewIPOpt(&conf.BridgeConfig.DefaultGatewayIPv6, ""), "default-gateway-v6", "Container default gateway IPv6 address")
    29  	flags.BoolVar(&conf.BridgeConfig.InterContainerCommunication, "icc", true, "Enable inter-container communication")
    30  	flags.Var(opts.NewIPOpt(&conf.BridgeConfig.DefaultIP, "0.0.0.0"), "ip", "Default IP when binding container ports")
    31  	flags.Var(opts.NewNamedRuntimeOpt("runtimes", &conf.Runtimes, config.StockRuntimeName), "add-runtime", "Register an additional OCI compatible runtime")
    32  	flags.StringVar(&conf.DefaultRuntime, "default-runtime", config.StockRuntimeName, "Default OCI runtime for containers")
    33  
    34  }