From 3ed6ba7870650be3e5d95936ef6d8b9a9308ed4a Mon Sep 17 00:00:00 2001 From: Alex Suraci Date: Sun, 30 Sep 2018 23:25:19 -0400 Subject: [PATCH] respect both config and container_config to be honest it's not clear what container_config is - maybe a deprecated field? looks like we should be using 'config' as a few images i've tried have only specified things there. --- cmd/in/main.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/cmd/in/main.go b/cmd/in/main.go index 61fdba2..c1cef79 100644 --- a/cmd/in/main.go +++ b/cmd/in/main.go @@ -130,9 +130,15 @@ func rootfsFormat(dest string, req InRequest, image v1.Image) { return } + env := append(cfg.Config.Env, cfg.ContainerConfig.Env...) + user := cfg.Config.User + if user == "" { + user = cfg.ContainerConfig.User + } + err = json.NewEncoder(meta).Encode(ImageMetadata{ - Env: cfg.ContainerConfig.Env, - User: cfg.ContainerConfig.User, + Env: env, + User: user, }) if err != nil { logrus.Errorf("failed to write image metadata: %s", err)