diff --git a/daemon/daemon.go b/daemon/daemon.go index bf1e34c097..4d6d43dc31 100644 --- a/daemon/daemon.go +++ b/daemon/daemon.go @@ -557,7 +557,7 @@ func NewDaemon(config *Config, registryService *registry.Service) (daemon *Daemo config.DisableBridge = isBridgeNetworkDisabled(config) // Verify the platform is supported as a daemon - if runtime.GOOS != "linux" && runtime.GOOS != "windows" { + if !platformSupported { return nil, ErrSystemNotSupported } diff --git a/daemon/daemon_unix.go b/daemon/daemon_unix.go index d57100d849..ae36dd94a8 100644 --- a/daemon/daemon_unix.go +++ b/daemon/daemon_unix.go @@ -1,4 +1,4 @@ -// +build !windows +// +build linux freebsd package daemon @@ -36,6 +36,7 @@ const ( // See https://git.kernel.org/cgit/linux/kernel/git/tip/tip.git/tree/kernel/sched/sched.h?id=8cd9234c64c584432f6992fe944ca9e46ca8ea76#n269 linuxMinCPUShares = 2 linuxMaxCPUShares = 262144 + platformSupported = true ) func (daemon *Daemon) Changes(container *Container) ([]archive.Change, error) { diff --git a/daemon/daemon_unsupported.go b/daemon/daemon_unsupported.go new file mode 100644 index 0000000000..987528f476 --- /dev/null +++ b/daemon/daemon_unsupported.go @@ -0,0 +1,5 @@ +// +build !linux,!freebsd,!windows + +package daemon + +const platformSupported = false diff --git a/daemon/daemon_windows.go b/daemon/daemon_windows.go index 3e006ce790..da2d2e570b 100644 --- a/daemon/daemon_windows.go +++ b/daemon/daemon_windows.go @@ -15,7 +15,10 @@ import ( "github.com/microsoft/hcsshim" ) -const DefaultVirtualSwitch = "Virtual Switch" +const ( + DefaultVirtualSwitch = "Virtual Switch" + platformSupported = true +) func (daemon *Daemon) Changes(container *Container) ([]archive.Change, error) { return daemon.driver.Changes(container.ID, container.ImageID)