github.com/Heebron/moby@v0.0.0-20221111184709-6eab4f55faf7/daemon/config/config_windows.go (about)

     1  package config // import "github.com/docker/docker/daemon/config"
     2  
     3  import (
     4  	"os"
     5  	"path/filepath"
     6  
     7  	"github.com/docker/docker/api/types"
     8  )
     9  
    10  const (
    11  	// StockRuntimeName is used by the 'default-runtime' flag in dockerd as the
    12  	// default value. On Windows keep this empty so the value is auto-detected
    13  	// based on other options.
    14  	StockRuntimeName = ""
    15  )
    16  
    17  // BridgeConfig stores all the bridge driver specific
    18  // configuration.
    19  type BridgeConfig struct {
    20  	commonBridgeConfig
    21  }
    22  
    23  // Config defines the configuration of a docker daemon.
    24  // It includes json tags to deserialize configuration from a file
    25  // using the same names that the flags in the command line uses.
    26  type Config struct {
    27  	CommonConfig
    28  
    29  	// Fields below here are platform specific. (There are none presently
    30  	// for the Windows daemon.)
    31  }
    32  
    33  // GetRuntime returns the runtime path and arguments for a given
    34  // runtime name
    35  func (conf *Config) GetRuntime(name string) *types.Runtime {
    36  	return nil
    37  }
    38  
    39  // GetAllRuntimes returns a copy of the runtimes map
    40  func (conf *Config) GetAllRuntimes() map[string]types.Runtime {
    41  	return map[string]types.Runtime{}
    42  }
    43  
    44  // GetExecRoot returns the user configured Exec-root
    45  func (conf *Config) GetExecRoot() string {
    46  	return ""
    47  }
    48  
    49  // GetInitPath returns the configured docker-init path
    50  func (conf *Config) GetInitPath() string {
    51  	return ""
    52  }
    53  
    54  // IsSwarmCompatible defines if swarm mode can be enabled in this config
    55  func (conf *Config) IsSwarmCompatible() error {
    56  	return nil
    57  }
    58  
    59  // ValidatePlatformConfig checks if any platform-specific configuration settings are invalid.
    60  func (conf *Config) ValidatePlatformConfig() error {
    61  	return nil
    62  }
    63  
    64  // IsRootless returns conf.Rootless on Linux but false on Windows
    65  func (conf *Config) IsRootless() bool {
    66  	return false
    67  }
    68  
    69  func setPlatformDefaults(cfg *Config) error {
    70  	cfg.Root = filepath.Join(os.Getenv("programdata"), "docker")
    71  	cfg.ExecRoot = filepath.Join(os.Getenv("programdata"), "docker", "exec-root")
    72  	cfg.Pidfile = filepath.Join(cfg.Root, "docker.pid")
    73  	return nil
    74  }