docker search命令的具體使用
一、docker search 命令選項
| 命令選項 | 描述 |
|---|---|
| –filter , -f | 根據(jù)給定的條件進行過濾 |
| –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收藏數(shù)量大于等于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 搜索結果通過多個條件過濾
如下為過濾自動構建的并且收藏數(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 可以通過 --format 參數(shù)定制自定義打印格式,可自定義的占位字段如下:
| 占位符 | 描述 |
|---|---|
| .Name | 鏡像名稱 |
| .Description | 鏡像描述 |
| .StarCount | 鏡像被收藏數(shù)量 |
| .IsOfficial | 鏡像是否為官方鏡像,如果是現(xiàn)實“OK” |
| .IsAutomated | 鏡像是否為自動構建,如果是顯示“OK” |
如下為搜索nginx鏡像,只顯示鏡像名稱和鏡像被收藏數(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 ~]#
如下,格式化顯示鏡像名稱、鏡像被收藏數(shù)量、鏡像是否自動構建、鏡像是否官方
[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命令內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關文章希望大家以后多多支持腳本之家!
相關文章
docker部署訪問postgres數(shù)據(jù)庫的實現(xiàn)方法
本文主要介紹了docker部署訪問postgres數(shù)據(jù)庫的實現(xiàn)方法,文中根據(jù)實例編碼詳細介紹的十分詳盡,具有一定的參考價值,感興趣的小伙伴們可以參考一下2022-03-03
MacOS使用Docker創(chuàng)建MySQL主從數(shù)據(jù)庫的方法
這篇文章主要介紹了MacOS使用Docker創(chuàng)建MySQL主從數(shù)據(jù)庫,本文給大家介紹的非常詳細,對大家的學習或工作具有一定的參考借鑒價值,需要的朋友可以參考下2021-12-12
docker部署nginx及nginx.conf文件配置方式
這篇文章主要介紹了docker部署nginx及nginx.conf文件配置方式,具有很好的參考價值,希望對大家有所幫助,如有錯誤或未考慮完全的地方,望不吝賜教2024-08-08
Docker搭建RabbitMq的普通集群和鏡像集群的詳細操作
這篇文章主要介紹了Docker搭建RabbitMq的普通集群和鏡像集群,我本機是window10,通過docker搭建兩個rabbitmq節(jié)點,本文給大家介紹的非常詳細,需要的朋友可以參考下2021-11-11
使用DockerFile構建鏡像與鏡像上傳的實現(xiàn)步驟
本文主要介紹了使用DockerFile構建鏡像與鏡像上傳的實現(xiàn)步驟,使用Dockerfile好處是自動化構建,確保環(huán)境的一致性和可重復性,跟蹤構建過程的演化等,文中通過圖文講解的非常詳細,需要的朋友可以參考下2024-02-02
解決Docker啟動Elasticsearch7.x報錯的問題
這篇文章主要介紹了解決Docker啟動Elasticsearch7.x報錯的問題,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧2020-11-11

