github.com/wozhu6104/docker@v20.10.10+incompatible/daemon/start_windows.go (about) 1 package daemon // import "github.com/docker/docker/daemon" 2 3 import ( 4 "github.com/Microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/options" 5 "github.com/Microsoft/opengcs/client" 6 "github.com/docker/docker/container" 7 "github.com/docker/docker/pkg/system" 8 ) 9 10 func (daemon *Daemon) getLibcontainerdCreateOptions(container *container.Container) (string, interface{}, error) { 11 12 // Set the runtime options to debug regardless of current logging level. 13 if system.ContainerdRuntimeSupported() { 14 opts := &options.Options{Debug: true} 15 return "", opts, nil 16 } 17 18 // TODO (containerd) - Probably need to revisit LCOW options here 19 // rather than blindly ignoring them. 20 21 // LCOW options. 22 if container.OS == "linux" { 23 config := &client.Config{} 24 if err := config.GenerateDefault(daemon.configStore.GraphOptions); err != nil { 25 return "", nil, err 26 } 27 // Override from user-supplied options. 28 for k, v := range container.HostConfig.StorageOpt { 29 switch k { 30 case "lcow.kirdpath": 31 config.KirdPath = v 32 case "lcow.bootparameters": 33 config.BootParameters = v 34 } 35 } 36 if err := config.Validate(); err != nil { 37 return "", nil, err 38 } 39 40 return "", config, nil 41 } 42 43 return "", nil, nil 44 }