start_windows.go 874 B

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