From 65875cf6cf4df19e4488940615c8037fcf1276eb Mon Sep 17 00:00:00 2001 From: Nicolas De Loof Date: Mon, 21 Oct 2019 15:41:56 +0200 Subject: [PATCH] If no image tag set use image content-digest This also make the compose spec compliant with docker stack deploy, which require service.image attribute set Signed-off-by: Nicolas De Loof --- render/render.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/render/render.go b/render/render.go index 11f391402..9ec84eec9 100644 --- a/render/render.go +++ b/render/render.go @@ -116,9 +116,13 @@ func render(appPath string, composeContent string, imageMap map[string]bundle.Im if err := processEnabled(rendered); err != nil { return nil, err } + // Apply relocation map for ix, service := range rendered.Services { if img, ok := imageMap[service.Name]; ok { service.Image = img.Image + if img.Image == "" { + service.Image = img.Digest + } rendered.Services[ix] = service } }