2015-05-15 23:34:26 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2015-12-10 23:35:10 +00:00
|
|
|
"fmt"
|
2015-07-30 19:39:19 +00:00
|
|
|
"os"
|
2015-12-10 23:35:10 +00:00
|
|
|
"syscall"
|
2015-07-30 19:39:19 +00:00
|
|
|
|
2015-12-10 23:35:10 +00:00
|
|
|
"github.com/Sirupsen/logrus"
|
2015-05-15 23:34:26 +00:00
|
|
|
"github.com/docker/docker/daemon"
|
2016-03-18 18:53:27 +00:00
|
|
|
"github.com/docker/docker/libcontainerd"
|
2015-12-10 23:35:10 +00:00
|
|
|
"github.com/docker/docker/pkg/mflag"
|
|
|
|
"github.com/docker/docker/pkg/system"
|
2015-05-15 23:34:26 +00:00
|
|
|
)
|
|
|
|
|
2015-12-10 23:35:10 +00:00
|
|
|
var defaultDaemonConfigFile = os.Getenv("programdata") + string(os.PathSeparator) + "docker" + string(os.PathSeparator) + "config" + string(os.PathSeparator) + "daemon.json"
|
|
|
|
|
2015-05-15 23:34:26 +00:00
|
|
|
// currentUserIsOwner checks whether the current user is the owner of the given
|
|
|
|
// file.
|
|
|
|
func currentUserIsOwner(f string) bool {
|
|
|
|
return false
|
|
|
|
}
|
2015-06-15 13:36:19 +00:00
|
|
|
|
|
|
|
// setDefaultUmask doesn't do anything on windows
|
|
|
|
func setDefaultUmask() error {
|
|
|
|
return nil
|
|
|
|
}
|
2015-07-30 19:39:19 +00:00
|
|
|
|
|
|
|
func getDaemonConfDir() string {
|
|
|
|
return os.Getenv("PROGRAMDATA") + `\docker\config`
|
|
|
|
}
|
2015-09-23 23:42:08 +00:00
|
|
|
|
|
|
|
// notifySystem sends a message to the host when the server is ready to be used
|
|
|
|
func notifySystem() {
|
|
|
|
}
|
2015-12-10 23:35:10 +00:00
|
|
|
|
|
|
|
// setupConfigReloadTrap configures a Win32 event to reload the configuration.
|
|
|
|
func setupConfigReloadTrap(configFile string, flags *mflag.FlagSet, reload func(*daemon.Config)) {
|
|
|
|
go func() {
|
|
|
|
sa := syscall.SecurityAttributes{
|
|
|
|
Length: 0,
|
|
|
|
}
|
|
|
|
ev := "Global\\docker-daemon-config-" + fmt.Sprint(os.Getpid())
|
|
|
|
if h, _ := system.CreateEvent(&sa, false, false, ev); h != 0 {
|
|
|
|
logrus.Debugf("Config reload - waiting signal at %s", ev)
|
|
|
|
for {
|
|
|
|
syscall.WaitForSingleObject(h, syscall.INFINITE)
|
2016-02-18 21:55:03 +00:00
|
|
|
if err := daemon.ReloadConfiguration(configFile, flags, reload); err != nil {
|
|
|
|
logrus.Error(err)
|
|
|
|
}
|
2015-12-10 23:35:10 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}()
|
|
|
|
}
|
2016-03-18 18:53:27 +00:00
|
|
|
|
|
|
|
func (cli *DaemonCli) getPlatformRemoteOptions() []libcontainerd.RemoteOption {
|
|
|
|
return nil
|
|
|
|
}
|
2016-03-24 18:42:03 +00:00
|
|
|
|
|
|
|
// getLibcontainerdRoot gets the root directory for libcontainerd to store its
|
|
|
|
// state. The Windows libcontainerd implementation does not need to write a spec
|
|
|
|
// or state to disk, so this is a no-op.
|
|
|
|
func (cli *DaemonCli) getLibcontainerdRoot() string {
|
|
|
|
return ""
|
|
|
|
}
|
2016-04-09 06:49:33 +00:00
|
|
|
|
|
|
|
func allocateDaemonPort(addr string) error {
|
|
|
|
return nil
|
|
|
|
}
|