docker search命令的具体使用

 更新时间:2023年02月13日 17:04:36   作者:redrose2100  
本文主要介绍了docker search命令的具体使用,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧

一、docker search 命令选项

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

二、docker search 使用实例

2.1 通过指定镜像名搜索

[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 搜索结果不进行截断显示

[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个

[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个

[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 搜索结果只列出自动构建的镜像

[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 搜索结果只列出官方镜像

[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的镜像

[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镜像,只显示镜像名称和镜像被收藏数量

[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 ~]#

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

[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 ~]#

到此这篇关于docker search命令的具体使用的文章就介绍到这了,更多相关docker search命令内容请搜索脚本之家以前的文章或继续浏览下面的相关文章希望大家以后多多支持脚本之家!

相关文章

  • docker之MySQL同步数据的实现

    docker之MySQL同步数据的实现

    本文主要介绍了docker之MySQL同步数据的实现,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧
    2022-07-07
  • 用docker部署RabbitMQ环境的详细介绍

    用docker部署RabbitMQ环境的详细介绍

    这篇文章主要介绍了用docker部署RabbitMQ环境,本文给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友可以参考下
    2021-07-07
  • Docker配置HTTP/HTTPS代理的方法

    Docker配置HTTP/HTTPS代理的方法

    本篇文章主要介绍了Docker配置HTTP/HTTPS代理的方法,小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧
    2018-06-06
  • docker部署kafka的方法步骤

    docker部署kafka的方法步骤

    本文主要介绍了docker部署kafka的方法步骤,文中通过示例代码介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们可以参考一下
    2021-10-10
  • Docker安装Redis并介绍可视化客户端进行操作

    Docker安装Redis并介绍可视化客户端进行操作

    这篇文章主要介绍了Docker安装Redis并介绍可视化客户端进行操作方法,本文通过实例代码给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友可以参考下
    2020-04-04
  • docker 查看进程, 内存, cup消耗的情况

    docker 查看进程, 内存, cup消耗的情况

    这篇文章主要介绍了docker 查看进程, 内存, cup消耗的情况,具有很好的参考价值,希望对大家有所帮助。一起跟随小编过来看看吧
    2021-03-03
  • Docker创建nacos容器的方法

    Docker创建nacos容器的方法

    这篇文章主要介绍了Docker创建nacos容器的方法,本文给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友参考下吧
    2024-03-03
  • Docker部署golang环境详解

    Docker部署golang环境详解

    最近想学习一下golang,自己之前一直把环境全部安装在docker上,所以这次也想把golang的环境安装在docker上,先不废话,直接上手
    2022-08-08
  • MacBookPro下docker的安装与使用教程

    MacBookPro下docker的安装与使用教程

    Windows与Linux下关于docker的安装使用方法有很多,今天小编这里给大家分享的是MacOS下docker的安装与简单使用案例,非常简单,给有需要的小伙伴参考下
    2017-03-03
  • docker启动ES内存溢出的解决方案

    docker启动ES内存溢出的解决方案

    这篇文章主要介绍了docker启动ES内存溢出的解决方案,具有很好的参考价值,希望对大家有所帮助。一起跟随小编过来看看吧
    2021-03-03

最新评论