From 262c0d66c0ff52a1ec916317409882e672f2eae1 Mon Sep 17 00:00:00 2001 From: Grzegorz Graczyk Date: Mon, 5 Jan 2015 11:26:52 +0100 Subject: [PATCH] check if tag wasn't used for image building --- plugin/publish/docker.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugin/publish/docker.go b/plugin/publish/docker.go index 387d44395..40873d83d 100644 --- a/plugin/publish/docker.go +++ b/plugin/publish/docker.go @@ -99,7 +99,10 @@ func (d *Docker) Write(f *buildfile.Buildfile) { // Tag and push all tags for _, tag := range d.Tags { - f.WriteCmd(fmt.Sprintf("docker tag %s:%s %s:%s", d.ImageName, buildImageTag, d.ImageName, tag)) + if tag != buildImageTag { + f.WriteCmd(fmt.Sprintf("docker tag %s:%s %s:%s", d.ImageName, buildImageTag, d.ImageName, tag)) + } + f.WriteCmd(fmt.Sprintf("docker push %s:%s", d.ImageName, tag)) }