Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add tag alias on docker hub without pulling an image

When I build image in CI I push it with a unique SHA tag. Then when I deploy it to production I want to change :latest alias to point to the same image like so:

docker pull org/foo:34f8a342
docker tag org/foo:34f8a342 org/foo:latest
docker push org/foo:latest

Now I want to avoid pulling this image. The problem is that container for deploy script is different from container that was used to build it so I don't have this image locally. Is there any way to add a tag alias on docker hub without the need to have this image locally?

like image 523
Poma Avatar asked Jan 21 '18 04:01

Poma


1 Answers

I'm not aware of tagging a docker image directly on docker hub. There's a workaround for your problem, that is tagging the image with two tags when building it. docker build allows to create multiple tags for one build:

docker build -t org/foo:34f8a342 -t org/foo:latest .
like image 132
dvnguyen Avatar answered Oct 03 '22 20:10

dvnguyen