github.com/ssdev-go/moby@v17.12.1-ce-rc2+incompatible/daemon/start_windows.go (about)

     1  package daemon
     2  
     3  import (
     4  	"github.com/Microsoft/opengcs/client"
     5  	"github.com/docker/docker/container"
     6  )
     7  
     8  func (daemon *Daemon) getLibcontainerdCreateOptions(container *container.Container) (interface{}, error) {
     9  	// LCOW options.
    10  	if container.OS == "linux" {
    11  		config := &client.Config{}
    12  		if err := config.GenerateDefault(daemon.configStore.GraphOptions); err != nil {
    13  			return nil, err
    14  		}
    15  		// Override from user-supplied options.
    16  		for k, v := range container.HostConfig.StorageOpt {
    17  			switch k {
    18  			case "lcow.kirdpath":
    19  				config.KirdPath = v
    20  			case "lcow.kernel":
    21  				config.KernelFile = v
    22  			case "lcow.initrd":
    23  				config.InitrdFile = v
    24  			case "lcow.vhdx":
    25  				config.Vhdx = v
    26  			case "lcow.bootparameters":
    27  				config.BootParameters = v
    28  			}
    29  		}
    30  		if err := config.Validate(); err != nil {
    31  			return nil, err
    32  		}
    33  
    34  		return config, nil
    35  	}
    36  
    37  	return nil, nil
    38  }