github.com/ruphin/docker@v1.10.1/docker/daemon_windows.go (about) 1 // +build daemon 2 3 package main 4 5 import ( 6 "fmt" 7 "os" 8 "syscall" 9 10 "github.com/Sirupsen/logrus" 11 apiserver "github.com/docker/docker/api/server" 12 "github.com/docker/docker/daemon" 13 "github.com/docker/docker/pkg/mflag" 14 "github.com/docker/docker/pkg/system" 15 ) 16 17 var defaultDaemonConfigFile = os.Getenv("programdata") + string(os.PathSeparator) + "docker" + string(os.PathSeparator) + "config" + string(os.PathSeparator) + "daemon.json" 18 19 func setPlatformServerConfig(serverConfig *apiserver.Config, daemonCfg *daemon.Config) *apiserver.Config { 20 return serverConfig 21 } 22 23 // currentUserIsOwner checks whether the current user is the owner of the given 24 // file. 25 func currentUserIsOwner(f string) bool { 26 return false 27 } 28 29 // setDefaultUmask doesn't do anything on windows 30 func setDefaultUmask() error { 31 return nil 32 } 33 34 func getDaemonConfDir() string { 35 return os.Getenv("PROGRAMDATA") + `\docker\config` 36 } 37 38 // notifySystem sends a message to the host when the server is ready to be used 39 func notifySystem() { 40 } 41 42 // setupConfigReloadTrap configures a Win32 event to reload the configuration. 43 func setupConfigReloadTrap(configFile string, flags *mflag.FlagSet, reload func(*daemon.Config)) { 44 go func() { 45 sa := syscall.SecurityAttributes{ 46 Length: 0, 47 } 48 ev := "Global\\docker-daemon-config-" + fmt.Sprint(os.Getpid()) 49 if h, _ := system.CreateEvent(&sa, false, false, ev); h != 0 { 50 logrus.Debugf("Config reload - waiting signal at %s", ev) 51 for { 52 syscall.WaitForSingleObject(h, syscall.INFINITE) 53 daemon.ReloadConfiguration(configFile, flags, reload) 54 } 55 } 56 }() 57 }