广告位联系
返回顶部
分享到

docker search命令的具体使用

DNS服务器 来源:互联网 作者:佚名 发布时间:2023-02-14 21:15:45 人浏览
摘要

一、docker search 命令选项 命令选项 描述 filter , -f 根据给定的条件进行过滤 format 自定义打印格式 limit 显示搜索结果,默认值25 no-trunc 回显结果不进行截断,全部显示 二、docker search 使

一、docker search 命令选项

命令选项 描述
–filter , -f 根据给定的条件进行过滤
–format 自定义打印格式
–limit 显示搜索结果,默认值25
–no-trunc 回显结果不进行截断,全部显示

二、docker search 使用实例

2.1 通过指定镜像名搜索

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

[root@redrose2100 ~]# docker search busybox

NAME                                DESCRIPTION                                     STARS     OFFICIAL   AUTOMATED

busybox                             Busybox base image.                             2754      [OK]

radial/busyboxplus                  Full-chain, Internet enabled, busybox made f…   49                   [OK]

yauritux/busybox-curl               Busybox with CURL                               18

arm32v7/busybox                     Busybox base image.                             10

arm64v8/busybox                     Busybox base image.                             4

odise/busybox-curl                                                                  4                    [OK]

i386/busybox                        Busybox base image.                             3

p7ppc64/busybox                     Busybox base image for ppc64.                   2

s390x/busybox                       Busybox base image.                             2

prom/busybox                        Prometheus Busybox Docker base images           2                    [OK]

busybox42/zimbra-docker-centos      A Zimbra Docker image, based in ZCS 8.8.9 an…   2                    [OK]

joeshaw/busybox-nonroot             Busybox container with non-root user nobody     2

vukomir/busybox                     busybox and curl                                1

spotify/busybox                     Spotify fork of https://hub.docker.com/_/bus…   1

busybox42/haraka-docker-centos      CentOS Haraka build with spamassassin, redis…   1                    [OK]

ppc64le/busybox                     Busybox base image.                             1

amd64/busybox                       Busybox base image.                             1

busybox42/nginx_php-docker-centos   This is a nginx/php-fpm server running on Ce…   1                    [OK]

ibmcom/busybox-ppc64le                                                              0

busybox42/alpine-pod                                                                0

antrea/busybox                                                                      0

openebs/busybox-client                                                              0

ibmcom/busybox                                                                      0

rancher/busybox                                                                     0

ibmcom/busybox-amd64                                                                0

[root@redrose2100 ~]#

2.2 搜索结果不进行截断显示

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

[root@redrose2100 ~]# docker search busybox --no-trunc

NAME                                DESCRIPTION                                                                                 STARS     OFFICIAL   AUTOMATED

busybox                             Busybox base image.                                                                         2754      [OK]

radial/busyboxplus                  Full-chain, Internet enabled, busybox made from scratch. Comes in git and cURL flavors.     49                   [OK]

yauritux/busybox-curl               Busybox with CURL                                                                           18

arm32v7/busybox                     Busybox base image.                                                                         10

odise/busybox-curl                                                                                                              4                    [OK]

arm64v8/busybox                     Busybox base image.                                                                         4

i386/busybox                        Busybox base image.                                                                         3

p7ppc64/busybox                     Busybox base image for ppc64.                                                               2

s390x/busybox                       Busybox base image.                                                                         2

prom/busybox                        Prometheus Busybox Docker base images                                                       2                    [OK]

busybox42/zimbra-docker-centos      A Zimbra Docker image, based in ZCS 8.8.9 and CentOS 7.                                     2                    [OK]

joeshaw/busybox-nonroot             Busybox container with non-root user nobody                                                 2

vukomir/busybox                     busybox and curl                                                                            1

spotify/busybox                     Spotify fork of https://hub.docker.com/_/busybox/ for testing helios.                       1

busybox42/haraka-docker-centos      CentOS Haraka build with spamassassin, redis and some other things.  Experimental still..   1                    [OK]

ppc64le/busybox                     Busybox base image.                                                                         1

amd64/busybox                       Busybox base image.                                                                         1

busybox42/nginx_php-docker-centos   This is a nginx/php-fpm server running on CentOS 7.                                         1                    [OK]

ibmcom/busybox-ppc64le                                                                                                          0

antrea/busybox                                                                                                                  0

busybox42/alpine-pod                                                                                                            0

openebs/busybox-client                                                                                                          0

ibmcom/busybox                                                                                                                  0

rancher/busybox                                                                                                                 0

ibmcom/busybox-amd64                                                                                                            0

[root@redrose2100 ~]#

2.3 设置搜索结果只显示10个

1

2

3

4

5

6

7

8

9

10

11

12

13

[root@redrose2100 ~]# docker search busybox --limit=10

NAME                     DESCRIPTION                                     STARS     OFFICIAL   AUTOMATED

busybox                  Busybox base image.                             2754      [OK]

radial/busyboxplus       Full-chain, Internet enabled, busybox made f…   49                   [OK]

yauritux/busybox-curl    Busybox with CURL                               18

vukomir/busybox          busybox and curl                                1

antrea/busybox                                                           0

ibmcom/busybox-amd64                                                     0

ibmcom/busybox-ppc64le                                                   0

rancher/busybox                                                          0

ibmcom/busybox                                                           0

openebs/busybox-client                                                   0

[root@redrose2100 ~]#

2.4 搜索结果过滤star收藏数量大于等于3个

1

2

3

4

5

6

7

8

9

10

[root@redrose2100 ~]# docker search busybox --filter stars=3

NAME                    DESCRIPTION                                     STARS     OFFICIAL   AUTOMATED

busybox                 Busybox base image.                             2754      [OK]

radial/busyboxplus      Full-chain, Internet enabled, busybox made f…   49                   [OK]

yauritux/busybox-curl   Busybox with CURL                               18

arm32v7/busybox         Busybox base image.                             10

odise/busybox-curl                                                      4                    [OK]

arm64v8/busybox         Busybox base image.                             4

i386/busybox            Busybox base image.                             3

[root@redrose2100 ~]#

2.5 搜索结果只列出自动构建的镜像

1

2

3

4

5

6

7

8

9

[root@redrose2100 ~]# docker search busybox --filter is-automated=true

NAME                                DESCRIPTION                                     STARS     OFFICIAL   AUTOMATED

radial/busyboxplus                  Full-chain, Internet enabled, busybox made f…   49                   [OK]

odise/busybox-curl                                                                  4                    [OK]

busybox42/zimbra-docker-centos      A Zimbra Docker image, based in ZCS 8.8.9 an…   2                    [OK]

prom/busybox                        Prometheus Busybox Docker base images           2                    [OK]

busybox42/haraka-docker-centos      CentOS Haraka build with spamassassin, redis…   1                    [OK]

busybox42/nginx_php-docker-centos   This is a nginx/php-fpm server running on Ce…   1                    [OK]

[root@redrose2100 ~]#

2.6 搜索结果只列出官方镜像

1

2

3

4

[root@redrose2100 ~]# docker search busybox --filter is-official=true

NAME      DESCRIPTION           STARS     OFFICIAL   AUTOMATED

busybox   Busybox base image.   2754      [OK]

[root@redrose2100 ~]#

2.7 搜索结果通过多个条件过滤

如下为过滤自动构建的并且收藏数量大于等于3的镜像

1

2

3

4

5

[root@redrose2100 ~]# docker search busybox --filter is-automated=true --filter stars=3

NAME                 DESCRIPTION                                     STARS     OFFICIAL   AUTOMATED

radial/busyboxplus   Full-chain, Internet enabled, busybox made f…   49                   [OK]

odise/busybox-curl                                                   4                    [OK]

[root@redrose2100 ~]#

2.8 定制自定义打印输出格式

docker search 可以通过 --format 参数定制自定义打印格式,可自定义的占位字段如下:

占位符 描述
.Name 镜像名称
.Description 镜像描述
.StarCount 镜像被收藏数量
.IsOfficial 镜像是否为官方镜像,如果是现实“OK”
.IsAutomated 镜像是否为自动构建,如果是显示“OK”

如下为搜索nginx镜像,只显示镜像名称和镜像被收藏数量

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

[root@redrose2100 ~]# docker search --format "{{.Name}}: {{.StarCount}}" nginx

nginx: 17429

linuxserver/nginx: 178

bitnami/nginx: 140

ubuntu/nginx: 61

bitnami/nginx-ingress-controller: 20

rancher/nginx-ingress-controller: 11

webdevops/nginx: 10

ibmcom/nginx-ingress-controller: 4

bitnami/nginx-ldap-auth-daemon: 3

rancher/nginx: 2

kasmweb/nginx: 2

vmware/nginx: 2

rancher/nginx-ingress-controller-defaultbackend: 2

rapidfort/nginx: 2

bitnami/nginx-exporter: 2

wallarm/nginx-ingress-controller: 1

vmware/nginx-photon: 1

bitnami/nginx-intel: 1

rapidfort/nginx-ib: 0

ibmcom/nginx-ingress-controller-ppc64le: 0

rancher/nginx-conf: 0

rancher/nginx-ssl: 0

continuumio/nginx-ingress-ws: 0

rancher/nginx-ingress-controller-amd64: 0

ibmcom/nginx-ppc64le: 0

[root@redrose2100 ~]#

如下,格式化显示镜像名称、镜像被收藏数量、镜像是否自动构建、镜像是否官方

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

[root@redrose2100 ~]# docker search --format "table {{.Name}}\t\t{{.StarCount}}\t\t{{.IsAutomated}}\t\t{{.IsOfficial}}" nginx

NAME                                                        STARS               AUTOMATED             OFFICIAL

nginx                                                       17429                                     [OK]

linuxserver/nginx                                           178

bitnami/nginx                                               140                 [OK]

ubuntu/nginx                                                61

bitnami/nginx-ingress-controller                            20                  [OK]

rancher/nginx-ingress-controller                            11

webdevops/nginx                                             10                  [OK]

ibmcom/nginx-ingress-controller                             4

bitnami/nginx-ldap-auth-daemon                              3

rancher/nginx                                               2

kasmweb/nginx                                               2

vmware/nginx                                                2

rancher/nginx-ingress-controller-defaultbackend             2

rapidfort/nginx                                             2

bitnami/nginx-exporter                                      2

wallarm/nginx-ingress-controller                            1

vmware/nginx-photon                                         1

bitnami/nginx-intel                                         1

rapidfort/nginx-ib                                          0

rancher/nginx-conf                                          0

ibmcom/nginx-ingress-controller-ppc64le                     0

rancher/nginx-ssl                                           0

continuumio/nginx-ingress-ws                                0

rancher/nginx-ingress-controller-amd64                      0

ibmcom/nginx-ppc64le                                        0

[root@redrose2100 ~]#


版权声明 : 本文内容来源于互联网或用户自行发布贡献,该文观点仅代表原作者本人。本站仅提供信息存储空间服务和不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权, 违法违规的内容, 请发送邮件至2530232025#qq.cn(#换@)举报,一经查实,本站将立刻删除。
原文链接 : https://blog.csdn.net/redrose2100/article/details/127013458
相关文章
  • k8s集群部署时etcd容器不停重启问题以及处理介绍
    问题现象 在安装部署Kubernetes 1.26版本时,通过kubeadm初始化集群后,发现执行kubectl命令报以下错误: The connection to the server localhost:8080 was
  • docker容器中文乱码的解决教程
    docker部署java开发web项目。nohup显示打印日志出现中文乱码,中文显示为问号???。 环境 服务器系统:centos7、docker部署项目 具体操作如下
  • 云原生Docker创建并进入mysql容器的全过程

    云原生Docker创建并进入mysql容器的全过程
    本文主要讲解的是创建mysql的容器,大家都知道,在外面进入mysql都很容易,mysql -u用户名 -p密码就可以,但是是容器的mysql就没那么好进入了
  • 云原生Docker容器自定义DNS解析

    云原生Docker容器自定义DNS解析
    描述 在特定的情况下,或者在网络策略特殊定义下,需要自定义dns进行域名访问,在宿主机上配置了域名解析,对于docker容器无效。 对于局
  • 半小时实现基于ChatGPT搭建微信机器人

    半小时实现基于ChatGPT搭建微信机器人
    ChatGPT刷屏了 相信大家最近被ChatGPT刷屏了,其实在差不多一个月前就火过一次,不会那会好像只在程序员的圈子里面火起来了,并没有被大
  • docker search命令的具体使用
    一、docker search 命令选项 命令选项 描述 filter , -f 根据给定的条件进行过滤 format 自定义打印格式 limit 显示搜索结果,默认值25 no-trunc 回显结
  • docker-cli源码窥探(推荐)

    docker-cli源码窥探(推荐)
    docker-cli源码窥探 最近一直在使用docker,看了一些书和教程,但是一直停在使用的层面,但总觉得不够深入,故决定看看源码,学习优秀的项
  • kvm 透传显卡至win10虚拟机的方法

    kvm 透传显卡至win10虚拟机的方法
    环境 1 2 3 4 5 6 7 8 9 10 11 已安装nvidia 显卡 驱动 操作系统:CentOS Linux release 7.9.2009 (Core) 内核版本:Linux 5.4.135-1.el7.elrepo.x86_64 显卡 型号:rtx 6000
  • Docker Desktop常见的几种启动失败问题解决方法

    Docker Desktop常见的几种启动失败问题解决方法
    报错1,Error:Failed to restart 点Quit 然后出现提示WSL 2 is not installed 点击 Use Hyper-V 打开 启用或关闭windows功能 确保适用于Linux的Windows子系统和
  • 使用Kubernetes自定义资源(CRD)的介绍
    什么是CRD CRD的全称为CustomResourceDefinitions,即自定义资源。k8s拥有一些内置的资源,比如说Pod,Deployment,ReplicaSet等等,而CRD则提供了一种方
  • 本站所有内容来源于互联网或用户自行发布,本站仅提供信息存储空间服务,不拥有版权,不承担法律责任。如有侵犯您的权益,请您联系站长处理!
  • Copyright © 2017-2022 F11.CN All Rights Reserved. F11站长开发者网 版权所有 | 苏ICP备2022031554号-1 | 51LA统计