網(wǎng)站首頁(yè) 編程語(yǔ)言 正文
一、docker search 命令選項(xiàng)
命令選項(xiàng) | 描述 |
---|---|
–filter , -f | 根據(jù)給定的條件進(jìn)行過(guò)濾 |
–format | 自定義打印格式 |
–limit | 顯示搜索結(jié)果,默認(rèn)值25 |
–no-trunc | 回顯結(jié)果不進(jìn)行截?cái)啵匡@示 |
二、docker search 使用實(shí)例
2.1 通過(guò)指定鏡像名搜索
[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 搜索結(jié)果不進(jìn)行截?cái)囡@示
[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 設(shè)置搜索結(jié)果只顯示10個(gè)
[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 搜索結(jié)果過(guò)濾star收藏?cái)?shù)量大于等于3個(gè)
[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 搜索結(jié)果只列出自動(dòng)構(gòu)建的鏡像
[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 搜索結(jié)果只列出官方鏡像
[root@redrose2100 ~]# docker search busybox --filter is-official=true
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
busybox Busybox base image. 2754 [OK]
[root@redrose2100 ~]#
2.7 搜索結(jié)果通過(guò)多個(gè)條件過(guò)濾
如下為過(guò)濾自動(dòng)構(gòu)建的并且收藏?cái)?shù)量大于等于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 可以通過(guò) --format 參數(shù)定制自定義打印格式,可自定義的占位字段如下:
占位符 | 描述 |
---|---|
.Name | 鏡像名稱(chēng) |
.Description | 鏡像描述 |
.StarCount | 鏡像被收藏?cái)?shù)量 |
.IsOfficial | 鏡像是否為官方鏡像,如果是現(xiàn)實(shí)“OK” |
.IsAutomated | 鏡像是否為自動(dòng)構(gòu)建,如果是顯示“OK” |
如下為搜索nginx鏡像,只顯示鏡像名稱(chēng)和鏡像被收藏?cái)?shù)量
[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 ~]#
如下,格式化顯示鏡像名稱(chēng)、鏡像被收藏?cái)?shù)量、鏡像是否自動(dòng)構(gòu)建、鏡像是否官方
[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 ~]#
原文鏈接:https://blog.csdn.net/redrose2100/article/details/127013458
相關(guān)推薦
- 2022-11-03 python數(shù)據(jù)分析基礎(chǔ)知識(shí)之shape()函數(shù)的使用教程_python
- 2023-02-12 C++?STL之string的模擬實(shí)現(xiàn)實(shí)例代碼_C 語(yǔ)言
- 2022-03-29 python?Tkinter是什么_python
- 2022-08-18 KubeSphere分級(jí)管理實(shí)踐及解析_云其它
- 2023-02-06 詳解C#如何加密解密RAR文件_C#教程
- 2022-10-23 Python繪制牛奶凍曲線(高木曲線)案例_python
- 2022-11-22 Android?10?啟動(dòng)分析之init語(yǔ)法詳解_Android
- 2022-06-22 如何利用Android仿微博正文鏈接交互效果_Android
- 最近更新
-
- window11 系統(tǒng)安裝 yarn
- 超詳細(xì)win安裝深度學(xué)習(xí)環(huán)境2025年最新版(
- Linux 中運(yùn)行的top命令 怎么退出?
- MySQL 中decimal 的用法? 存儲(chǔ)小
- get 、set 、toString 方法的使
- @Resource和 @Autowired注解
- Java基礎(chǔ)操作-- 運(yùn)算符,流程控制 Flo
- 1. Int 和Integer 的區(qū)別,Jav
- spring @retryable不生效的一種
- Spring Security之認(rèn)證信息的處理
- Spring Security之認(rèn)證過(guò)濾器
- Spring Security概述快速入門(mén)
- Spring Security之配置體系
- 【SpringBoot】SpringCache
- Spring Security之基于方法配置權(quán)
- redisson分布式鎖中waittime的設(shè)
- maven:解決release錯(cuò)誤:Artif
- restTemplate使用總結(jié)
- Spring Security之安全異常處理
- MybatisPlus優(yōu)雅實(shí)現(xiàn)加密?
- Spring ioc容器與Bean的生命周期。
- 【探索SpringCloud】服務(wù)發(fā)現(xiàn)-Nac
- Spring Security之基于HttpR
- Redis 底層數(shù)據(jù)結(jié)構(gòu)-簡(jiǎn)單動(dòng)態(tài)字符串(SD
- arthas操作spring被代理目標(biāo)對(duì)象命令
- Spring中的單例模式應(yīng)用詳解
- 聊聊消息隊(duì)列,發(fā)送消息的4種方式
- bootspring第三方資源配置管理
- GIT同步修改后的遠(yuǎn)程分支