Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to pull a single image from any docker repository?

Tags:

The docker repositories contains multiple images. Is it possible to just pull the specific image from Repository.

When I use:

docker pull  ubuntu

It pulls down around 8-10 different versions of ubuntu.

like image 969
Ananda Avatar asked Mar 15 '14 18:03

Ananda


People also ask

How do I pull an image from a private docker repository?

In order to pull images from your private repository, you'll need to login to Docker. If no registry URI is specified, Docker will assume you intend to use or log out from Docker Hub. Triton comes with several images built-in. You can view the available list with triton images .

Can we extract docker image?

If you want to get the image on your other machine and don't want to build it again then the ideal way is push the docker image created on your Ubuntu server to docker hub repository. Then you can simply do the docker pull to pull the image at any machine.

How do I push a docker image to a specific repository?

To push an image to Docker Hub, you must first name your local image using your Docker Hub username and the repository name that you created through Docker Hub on the web. You can add multiple images to a repository by adding a specific :<tag> to them (for example docs/base:testing ).

What is the command to pull multiple docker images from a repository?

By default, docker pull pulls a single image from the registry. A repository can contain multiple images. To pull all images from a repository, provide the -a (or --all-tags ) option when using docker pull .


1 Answers

If there's a specific image that's tagged, you could use the --tag= (or -t) operator to pull the specific image you're looking for. There's a shorthand form for the command as well, which uses just a colon between the image name and the tag.

So if you want the version of ubuntu that's tagged as quantal, you could use:

docker pull ubuntu:quantal

The longer forms would be:

docker pull --tag="quantal" ubuntu
docker pull --t quantal ubuntu

This will still pull the historical layers used to build the final image, but will be a smaller subset than all of the layers for ubuntu.

[Updated to include Ben's note on shorthand from below. Thanks!]

like image 77
johncosta Avatar answered Sep 18 '22 17:09

johncosta