Saurabh Shah
Saurabh Shah

Reputation: 606

Dockerhub Automated Builds tagging

I have created an automated build on dockerhub, but unfortunately I didn't find any proper documentation for those.

Basically, I am creating a system where docker automated build is triggered as soon as there is a commit in github repository. So how can I keep my docker tag a variable? Such that whenever there is a commit, the image being built is tagged with the latest commit's sha1.

I can put a regex in branch name or tag name, can't I put a regex in docker tag name? Here I wish to trigger the build by specifying the curl by docker tag name.

Upvotes: 2

Views: 998

Answers (1)

Chris
Chris

Reputation: 10435

I don't think what you want is possible. The only variable you can use in the docker tag name is {sourceref}, which expands to the branch or tag name.

I presume this was deliberate -- you'd vastly increase the number of images that Docker Hub had to store if each commit was given a different docker tag.


You could try using a continuous integration/deployment service to build the images outside of Docker Hub. There are many to chose from, but Travis and Circle are popular ones that should be able to do what you want.

Upvotes: 2

Related Questions