如何从任何码头仓库中拉一张图像? [英] How to pull a single image from any docker repository?

查看:96
本文介绍了如何从任何码头仓库中拉一张图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

码头仓库包含多个图像。可以从Repository中拉出特定的图像。



当我使用:

  docker pull ubuntu 

它下拉了大约8-10个不同版本的ubuntu。 / p>

解决方案

如果有一个特定的图片被标记,可以使用--tag =(或-t)你想要的图像这个命令也有一个简写形式,它只使用图像名称和标签之间的一个冒号。



所以如果你想要标记为量子的ubuntu版本,您可以使用:

  docker pull ubuntu:quantal 

较长的表单将是:

  docker pull --tag =量子ubuntu 
docker pull --t quantal ubuntu

这仍然会拖动历史层用于构建最终的图像,但是将比ubuntu的所有图层更小的子集。



[更新以包含本文从下面的简写。谢谢!]


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

这篇关于如何从任何码头仓库中拉一张图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆