diff --git a/image/config.go b/image/config.go index 71d98a7..d3fd922 100644 --- a/image/config.go +++ b/image/config.go @@ -64,11 +64,18 @@ func findConfig(w walker, d *v1.Descriptor) (*v1.Image, error) { } func runtimeSpec(c *v1.Image, 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{} 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.Root = &specs.Root{} @@ -107,8 +114,6 @@ func runtimeSpec(c *v1.Image, 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,