From 39ad38ccf928882171e38c866e61506d1a98508c Mon Sep 17 00:00:00 2001 From: John Howard Date: Thu, 16 Jul 2015 15:33:13 -0700 Subject: [PATCH] Windows: hostconfig on start Signed-off-by: John Howard --- daemon/start.go | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/daemon/start.go b/daemon/start.go index 2715022e89..9df56c5a34 100644 --- a/daemon/start.go +++ b/daemon/start.go @@ -2,6 +2,7 @@ package daemon import ( "fmt" + "runtime" "github.com/docker/docker/runconfig" ) @@ -24,11 +25,18 @@ func (daemon *Daemon) ContainerStart(name string, hostConfig *runconfig.HostConf return err } - // This is kept for backward compatibility - hostconfig should be passed when - // creating a container, not during start. - if hostConfig != nil { - if err := daemon.setHostConfig(container, hostConfig); err != nil { - return err + // Windows does not have the backwards compatibilty issue here. + if runtime.GOOS != "windows" { + // This is kept for backward compatibility - hostconfig should be passed when + // creating a container, not during start. + if hostConfig != nil { + if err := daemon.setHostConfig(container, hostConfig); err != nil { + return err + } + } + } else { + if hostConfig != nil { + return fmt.Errorf("Supplying a hostconfig on start is not supported. It should be supplied on create") } }