docker pull image using several tags

Viewed 3297

I have an image in AWS ECR with several tags. For example:

image name: myapp

tags: 1.0.1 , staging , latest

Now I want to pull this docker image using the version number tag + environment tag.

I already have tried:

docker pull 123456789.dkr.ecr.us-west-100.amazonaws.com/myapp:1.0.1:staging

but I get the error:

invalid reference format

Do you know if this is possible somehow?

Remark: using only 1 tag it's working. For example: myapp:1.0.1

1 Answers

after docker docs

--all-tags, -a false Download all tagged images in the repository

so you can actually do following to get ALL tags:

docker pull --all-tags 123456789.dkr.ecr.us-west-100.amazonaws.com/myapp

If you do require just some tags it's sadly impossible at the moment, but for that you can just put it inside of a script or && it or whatever else you like.

Related