测试开发技术网站
博客
设计
设计
开发
Python
测试
unittest
运维
Linux基础应用
CI/CD
CI/CD
数据库
数据库
云计算
云计算
云原生
云原生
爬虫
爬虫
数据分析
数据分析
人工智能
人工智能
登录
注册
Docker----docker search 命令详解
收藏本文
作者:redrose2100 类别: 日期:2022-09-23 08:24:59 阅读:806 次 消耗积分:0 分
![](https://redrose2100.oss-cn-hangzhou.aliyuncs.com/img/06c9f19c-9517-11ee-b9ec-0242ac110004.png) [TOC] # 一、docker search 命令选项 |命令选项|描述| |:--:|:--:| |--filter , -f|根据给定的条件进行过滤| |--format|自定义打印格式| |--limit|显示搜索结果,默认值25| |--no-trunc|回显结果不进行截断,全部显示| # 二、docker search 使用实例 ## 2.1 通过指定镜像名搜索 ```bash [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 搜索结果不进行截断显示 ```bash [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个 ```bash [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个 ```bash [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 搜索结果只列出自动构建的镜像 ```bash [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 搜索结果只列出官方镜像 ```bash [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的镜像 ```bash [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镜像,只显示镜像名称和镜像被收藏数量 ```bash [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 ~]# ``` 如下,格式化显示镜像名称、镜像被收藏数量、镜像是否自动构建、镜像是否官方 ```bash [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 ~]# ```
始终坚持开源开放共享精神,同时感谢您的充电鼓励和支持!
版权所有,转载本站文章请注明出处:redrose2100, http://blog.redrose2100.com/article/384
上一篇:
Docker----docker images 命令详解
下一篇:
FastAPI简介与快速体验
搜索
个人成就
出版书籍
《Pytest企业级应用实战》
测试开发技术全栈公众号
测试开发技术全栈公众号
DevOps技术交流微信群
加微信邀请进群
常用网站链接
开源软件洞察
云原生技术栈全景图
Python语言官方文档
Golang官方文档
Docker官方文档
Jenkins中文用户手册
Scrapy官方文档
VUE官方文档
Harbor官方文档
openQA官方文档
云原生开源社区
开源中国
Kubernetes中文文档
Markdown语法官方教程
Kubernetes中文社区
Kubersphere官方文档
BootStrap中文网站
JavaScript中文网
NumPy官方文档
Pandas官方文档
GitLink确实开源网站
数据库排名网站
编程语言排名网站
SEO综合查询网站
数学加减法练习自动生成网站
Kickstart Generator
文章分类
最新文章
最多阅读
特别推荐
×
Close
登录
注册
找回密码
登录邮箱:
登录密码:
图片验证码:
注册邮箱:
注册密码:
邮箱验证码:
发送邮件
注册邮箱:
新的密码:
邮箱验证码:
发送邮件