From 0d957b1da55f86c354628853cfebec394e66ce81 Mon Sep 17 00:00:00 2001 From: Stephen J Day Date: Mon, 27 Nov 2017 16:54:29 -0800 Subject: [PATCH] oci: allocate process if not already set Signed-off-by: Stephen J Day --- oci/spec_opts_unix.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/oci/spec_opts_unix.go b/oci/spec_opts_unix.go index 5ca2f0f0a..b17ca3216 100644 --- a/oci/spec_opts_unix.go +++ b/oci/spec_opts_unix.go @@ -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...)