diff --git a/image/config.go b/image/config.go index 160f435..0778b06 100644 --- a/image/config.go +++ b/image/config.go @@ -66,11 +66,19 @@ func findConfig(w walker, d *v1.Descriptor) (*config, error) { } func (c *config) runtimeSpec(rootfs string) (*specs.Spec, error) { - if c.OS != "linux" { + var s specs.Spec + + switch c.OS { + case "linux": + s.Linux = &specs.Linux{} + case "solaris": + s.Solaris = &specs.Solaris{} + case "windows": + s.Windows = &specs.Windows{} + default: return nil, fmt.Errorf("%s: unsupported OS", c.OS) } - var s specs.Spec s.Version = specs.Version // we should at least apply the default spec, otherwise this is totally useless s.Process.Terminal = true @@ -106,8 +114,6 @@ func (c *config) runtimeSpec(rootfs string) (*specs.Spec, error) { return nil, errors.New("config.User: unsupported format") } - s.Linux = &specs.Linux{} - for vol := range c.Config.Volumes { s.Mounts = append( s.Mounts,