github.com/jwhonce/docker@v0.6.7-0.20190327063223-da823cf3a5a3/pkg/system/init_windows.go (about) 1 package system // import "github.com/docker/docker/pkg/system" 2 3 import ( 4 "os" 5 6 "github.com/sirupsen/logrus" 7 ) 8 9 var ( 10 // lcowSupported determines if Linux Containers on Windows are supported. 11 lcowSupported = false 12 13 // containerdRuntimeSupported determines if ContainerD should be the runtime. 14 // As of March 2019, this is an experimental feature. 15 containerdRuntimeSupported = false 16 ) 17 18 // InitLCOW sets whether LCOW is supported or not 19 func InitLCOW(experimental bool) { 20 v := GetOSVersion() 21 if experimental && v.Build >= 16299 { 22 lcowSupported = true 23 } 24 } 25 26 // InitContainerdRuntime sets whether to use ContainerD for runtime 27 // on Windows. This is an experimental feature still in development, and 28 // also requires an environment variable to be set (so as not to turn the 29 // feature on from simply experimental which would also mean LCOW. 30 func InitContainerdRuntime(experimental bool, cdPath string) { 31 if experimental && len(cdPath) > 0 && len(os.Getenv("DOCKER_WINDOWS_CONTAINERD_RUNTIME")) > 0 { 32 logrus.Warnf("Using ContainerD runtime. This feature is experimental") 33 containerdRuntimeSupported = true 34 } 35 } 36 37 // ContainerdRuntimeSupported returns true if the use of ContainerD runtime is supported. 38 func ContainerdRuntimeSupported() bool { 39 return containerdRuntimeSupported 40 }