github.com/sijibomii/docker@v0.0.0-20231230191044-5cf6ca554647/daemon/config_windows.go (about)

     1  package daemon
     2  
     3  import (
     4  	"os"
     5  
     6  	flag "github.com/docker/docker/pkg/mflag"
     7  )
     8  
     9  var (
    10  	defaultPidFile = os.Getenv("programdata") + string(os.PathSeparator) + "docker.pid"
    11  	defaultGraph   = os.Getenv("programdata") + string(os.PathSeparator) + "docker"
    12  )
    13  
    14  // bridgeConfig stores all the bridge driver specific
    15  // configuration.
    16  type bridgeConfig struct {
    17  	commonBridgeConfig
    18  }
    19  
    20  // Config defines the configuration of a docker daemon.
    21  // These are the configuration settings that you pass
    22  // to the docker daemon when you launch it with say: `docker daemon -e windows`
    23  type Config struct {
    24  	CommonConfig
    25  
    26  	// Fields below here are platform specific. (There are none presently
    27  	// for the Windows daemon.)
    28  }
    29  
    30  // InstallFlags adds command-line options to the top-level flag parser for
    31  // the current process.
    32  // Subsequent calls to `flag.Parse` will populate config with values parsed
    33  // from the command-line.
    34  func (config *Config) InstallFlags(cmd *flag.FlagSet, usageFn func(string) string) {
    35  	// First handle install flags which are consistent cross-platform
    36  	config.InstallCommonFlags(cmd, usageFn)
    37  
    38  	// Then platform-specific install flags.
    39  	cmd.StringVar(&config.bridgeConfig.FixedCIDR, []string{"-fixed-cidr"}, "", usageFn("IPv4 subnet for fixed IPs"))
    40  	cmd.StringVar(&config.bridgeConfig.Iface, []string{"b", "-bridge"}, "", "Attach containers to a virtual switch")
    41  	cmd.StringVar(&config.SocketGroup, []string{"G", "-group"}, "", usageFn("Users or groups that can access the named pipe"))
    42  }