check if tag wasn't used for image building

This commit is contained in:
Grzegorz Graczyk 2015-01-05 11:26:52 +01:00
parent 0a6227930d
commit 262c0d66c0

View file

@ -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))
}