oci: allocate process if not already set

Signed-off-by: Stephen J Day <stephen.day@docker.com>
This commit is contained in:
Stephen J Day 2017-11-27 16:54:29 -08:00
parent abeb262d0d
commit 0d957b1da5
No known key found for this signature in database
GPG Key ID: 67B3DED84EDC823F

View File

@ -89,6 +89,11 @@ func WithImageConfig(image Image) SpecOpts {
default:
return fmt.Errorf("unknown image config media type %s", ic.MediaType)
}
if s.Process == nil {
s.Process = &specs.Process{}
}
s.Process.Env = append(s.Process.Env, config.Env...)
cmd := config.Cmd
s.Process.Args = append(config.Entrypoint, cmd...)