Hi. I'm currently limited to have only one tag per docker image builded by this plugin. I would like to tag images both by "nightly-$BUILD_ID" tag and "latest" tag.

          [JENKINS-25689] Multiple tagging of docker images

          Julien R. added a comment -

          That would be nice, or at least a check box to update the 'latest' tag, since the registry is not doing it itself.

          Julien R. added a comment - That would be nice, or at least a check box to update the 'latest' tag, since the registry is not doing it itself.

          Mark Butler added a comment -

          I just created a pull request here that provides the functionality Julien R requests: https://github.com/jenkinsci/docker-build-publish-plugin/pull/6

          Mark Butler added a comment - I just created a pull request here that provides the functionality Julien R requests: https://github.com/jenkinsci/docker-build-publish-plugin/pull/6

          Mark Butler added a comment -

          I pulled the PR request, I can't get it to work.

          I think the problem is when you push to Docker hub an image automatically gets marked as latest.

          But the same does not seem to happen for a local / private registry.

          However if I make an image with two tags, what actually happens is I end up with two images ... and I can only push one of them.

          Comments / ideas are welcome. I have left my code up for now.

          Mark Butler added a comment - I pulled the PR request, I can't get it to work. I think the problem is when you push to Docker hub an image automatically gets marked as latest. But the same does not seem to happen for a local / private registry. However if I make an image with two tags, what actually happens is I end up with two images ... and I can only push one of them. Comments / ideas are welcome. I have left my code up for now.

          Mark Butler added a comment -

          Possibly related issue on Docker-Registry: https://github.com/docker/docker-registry/issues/637

          Mark Butler added a comment - Possibly related issue on Docker-Registry: https://github.com/docker/docker-registry/issues/637

          Mark Butler added a comment -

          Mark Butler added a comment - There are two related StackOverflow posts: http://stackoverflow.com/questions/21928780/create-multiple-tag-docker-image http://stackoverflow.com/questions/22080706/how-to-create-named-and-latest-tag-in-docker

          Mark Butler added a comment -

          I think I know how to solve this now. You use build the image. Then you get a hash back. Then you tag the hash. Then you push the hash. If you push either of the tags, it only pushes that tag into the local registry.

          The behavior of the local registry seems to be different to DockerHub, it doesn't seem quite so involved there.

          Mark Butler added a comment - I think I know how to solve this now. You use build the image. Then you get a hash back. Then you tag the hash. Then you push the hash. If you push either of the tags, it only pushes that tag into the local registry. The behavior of the local registry seems to be different to DockerHub, it doesn't seem quite so involved there.

          Mark Butler added a comment -

          I understand what the problem is now - I think it was this change:

          https://github.com/jenkinsci/docker-build-publish-plugin/pull/3

          before the push would have pushed all the tags - including the latest.

          But after the change it only pushed the version with the explicit tag e.g. kafka:0.8.1 or kafka:VERSION_28 depending on how you generated the tag, but not kafka:latest.

          So the solution is not to add any additional tags, but to push the one tagged latest as well as the one with the explicit tag. I have tried this and it works.

          There is a new revised PR here - I can confirm that this does work:

          https://github.com/jenkinsci/docker-build-publish-plugin/pull/7

          Maybe though the checkbox is unnecessary - latest should automatically be pushed as well as the explicit tag?

          Mark Butler added a comment - I understand what the problem is now - I think it was this change: https://github.com/jenkinsci/docker-build-publish-plugin/pull/3 before the push would have pushed all the tags - including the latest. But after the change it only pushed the version with the explicit tag e.g. kafka:0.8.1 or kafka:VERSION_28 depending on how you generated the tag, but not kafka:latest. So the solution is not to add any additional tags, but to push the one tagged latest as well as the one with the explicit tag. I have tried this and it works. There is a new revised PR here - I can confirm that this does work: https://github.com/jenkinsci/docker-build-publish-plugin/pull/7 Maybe though the checkbox is unnecessary - latest should automatically be pushed as well as the explicit tag?

          Michael Neale added a comment -

          This was addressed by a few recent pull requests and other improvements.

          Michael Neale added a comment - This was addressed by a few recent pull requests and other improvements.

            michaelneale Michael Neale
            marq_c Marek Chodor
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: