From 6104eb1ae2890371ef0f7440514ee505d73d2c0a Mon Sep 17 00:00:00 2001 From: Tibor Vass Date: Mon, 3 Jun 2019 22:34:13 +0000 Subject: [PATCH] build: fix panic when exporting to tar Fixes a panic on `docker build -t foo -o - . >/dev/null` Signed-off-by: Tibor Vass --- api/server/backend/build/backend.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/api/server/backend/build/backend.go b/api/server/backend/build/backend.go index ff7a5a9b42..0178091695 100644 --- a/api/server/backend/build/backend.go +++ b/api/server/backend/build/backend.go @@ -91,7 +91,9 @@ func (b *Backend) Build(ctx context.Context, config backend.BuildConfig) (string stdout := config.ProgressWriter.StdoutFormatter fmt.Fprintf(stdout, "Successfully built %s\n", stringid.TruncateID(imageID)) } - err = tagger.TagImages(image.ID(imageID)) + if imageID != "" { + err = tagger.TagImages(image.ID(imageID)) + } return imageID, err }