如何在docker命令行的docker注册表中找到具有特定标签的docker image? [英] how can I find docker image with specific tag in docker registry in docker command line?

查看:133
本文介绍了如何在docker命令行的docker注册表中找到具有特定标签的docker image?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试找到一个特定的码头码头码头图像,我该怎么做在命令行?我尝试避免下载所有内容并删除不需要的图像。



在官方Ubuntu版本 https://registry.hub.docker.com/_/ubuntu/ 有几个标签(为其释放),而当我在命令行中搜索

 用户@ ubuntu:〜$ docker搜索ubuntu | grep ^ ubuntu 
ubuntu官方Ubuntu基本图像354
ubuntu-upstart Upstart是一个基于事件的替代... 7
ubuntufan / ping 0
ubuntu-debootstrap 0

同样在命令行的帮助下 search https://docs.docker.com/engine/reference/commandline/search/ ,不知道如何工作?



是否可以在 docker search 命令?



如果我使用raw命令通过 docker注册表API ,那么可以获取信息

  $ curl https://registry.hub.docker.com// v1 / repositories / ubuntu / tags | python -mjson.tool 
[
{
layer:ef83896b,
name:latest
},
.. ...
{
layer:463ff6be,
name:raring
},
{
layer 195eb90b,
name:saucy
},
{
layer:ef83896b,
name:trusty
}
]


解决方案

如我所知,CLI不允许在存储库中搜索/列出标签。



但是,如果你知道你想要哪个标签,你可以通过添加一个冒号和图像名称: docker pull ubuntu:saucy


I try to locate one specific tag for docker image, how can I do it in command line ? I try to avoid to download all and remove unneeded images.

In official Ubuntu release https://registry.hub.docker.com/_/ubuntu/ there are several tags (release for it), while when I search it in command line

user@ubuntu:~$ docker search ubuntu | grep ^ubuntu
ubuntu              Official Ubuntu base image                          354
ubuntu-upstart      Upstart is an event-based replacement for ...   7
ubuntufan/ping                                                0
ubuntu-debootstrap                                                   0

Also in the help of command line search https://docs.docker.com/engine/reference/commandline/search/, no clue how it can work ?

Is it possible in docker search command ?

If I use raw command to search via docker registry API, then the information can be fetched

   $ curl https://registry.hub.docker.com//v1/repositories/ubuntu/tags | python -mjson.tool
   [
    {
        "layer": "ef83896b",
        "name": "latest"
    },
    .....
    {
        "layer": "463ff6be",
        "name": "raring"
    },
    {
        "layer": "195eb90b",
        "name": "saucy"
    },
    {
        "layer": "ef83896b",
        "name": "trusty"
    }
]

解决方案

As far as I know, the CLI does not allow searching/listing tags in a repository.

But if you know which tag you want, you can pull that explicitly by adding a colon and the image name: docker pull ubuntu:saucy

这篇关于如何在docker命令行的docker注册表中找到具有特定标签的docker image?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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