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.

有帮助吗?

解决方案

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!]

其他提示

You can also use

docker pull reponame:tagname
docker pull ubantu:quantal
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top