Drone Docker Image Tagging


I’m playing around with Drone to see if it works for our needs, and I can’t find a way to:

  • Automatically and incrementally tag built docker images. For example, Drone builds an image and tags it 1.0 because it’s new. Pipeline runs again, and automatically tags it 1.1 because there is already one. And so on.


  • Automatically tag built docker images with the version specified in the GIT Release. So, we push to Git, Drone builts and pushes to the DEV registry. Then we create a release, and drone builts, tags with the release version, and pushes to the production registry.

Is any of this possible?


First, keep in mind that Drone is just a dumb shell script runner, so you should be able to program all of the above in shell scripts.

Second, Drone supports the concept of plugins which encapsulate custom logic into re-usable pipeline steps. There is a Docker plugin [1] that you can use to build and publish images, and you can construct your own tags [2] or use its autotag [3] feature. And you always have the option to write your own plugin if you don’t like the way an existing plugin works.

[1] http://plugins.drone.io/drone-plugins/drone-docker/
[2] https://docs.drone.io/pipeline/environment/substitution/
[3] http://plugins.drone.io/drone-plugins/drone-docker/#autotag