Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add tags to docker images made using autobuild

I've searched around and can't find a real answer to this. If I create a docker git repo and set up autobuild to my dockerhub account, it will build with a single tag (i.e. latest, or 1.0 or foo) but I can't find any way to add a tag afterwards as you can via command line with a locally built docker image. Pulling down the image and then retagging doesn't work as the autobuild repos are read-only outside of the webui.

Being able to manually add a tag to an existing build would satisfy me for now, but being able to script in something to grab the correct tag version would be the best solution.

like image 985
Justin Avatar asked Sep 29 '14 03:09

Justin


People also ask

How do I add tags while building docker image?

docker build -t image_name:tag_name . otherwise it will give latest tag to you image automatically. Save this answer.

How do I tag an image in docker?

Docker tags are just an alias for an image ID. The tag's name must be an ASCII character string and may include lowercase and uppercase letters, digits, underscores, periods, and dashes. In addition, the tag names must not begin with a period or a dash, and they can only contain 128 characters.

Which command is used to build and tag the docker image?

The docker build command builds Docker images from a Dockerfile and a “context”. A build's context is the set of files located in the specified PATH or URL .

How do I push multiple tags in docker?

Use the -a (or --all-tags ) option to push all tags of a local image. The following example creates multiple tags for an image, and pushes all those tags to Docker Hub.


1 Answers

You can do this through the UI somewhat indirectly:

  • Select Automated Build

Automated Build

  • Add a new build trigger

Build Trigger

  • Select Tag from the drop down on the left
  • Enter the git commit hash of the change you want tagged as the Name
  • Enter the tag you want to add to your build Tag
like image 132
Usman Ismail Avatar answered Sep 29 '22 08:09

Usman Ismail