Docker8- docker search 命令详解

如果你还想从头学起 Docker,可以看看这个系列的文章哦!

https://www.cnblogs.com/poloyy/category/1870863.html

 

作用

从 Docker Hub 查找镜像

 

语法格式

docker search [OPTIONS] TERM

 

options 说明

option 作用
-f,--filter filter 根据提供的 filter 过滤输出
--limit int 搜索结果条数最大为 int(默认25)
--no-trunc 显示完整的镜像 description

--format

使用 Go 模板进行美观打印

 

简单栗子

 

--filter 栗子

stars 的栗子

搜索 star 数量>3 的 busybox 镜像并打印详细描述

docker search --filter=stars=3 --no-trunc busybox                                                                     
NAME                    DESCRIPTION                                                                               STARS     OFFICIAL   AUTOMATED
busybox                 Busybox base image.                                                                       2272      [OK]
progrium/busybox                                                                                                  70                   [OK]
radial/busyboxplus      Full-chain,Internet enabled,busybox made from scratch. Comes in git and cURL flavors.   40                   [OK]
yauritux/busybox-curl   Busybox with CURL                                                                         16
arm32v7/busybox         Busybox base image.                                                                       9
armhf/busybox           Busybox base image.                                                                       6
odise/busybox-curl                                                                                                4                    [OK]
arm64v8/busybox         Busybox base image.

 

搜索 star 数量>3000 的 mysql 镜像

docker search mysql --filter=STARS=3000                                                                          
NAME      DESCRIPTION                                     STARS     OFFICIAL   AUTOMATED
mysql     MySQL is a widely used,open-source relation…   11063     [OK]
mariadb   MariaDB Server is a high performing open sou…   4193      [OK]

 

is-automated 的栗子

搜索自动构建的 busybox 镜像

docker search --filter is-automated=true busybox                                                                     
NAME                     DESCRIPTION                                     STARS     OFFICIAL   AUTOMATED
progrium/busybox                                                                            [OK]
radial/busyboxplus       Full-chain,busybox made f…                      [OK]
odise/busybox-curl                                                                           [OK]
odise/busybox-python                                                                         [OK]
prom/busybox             Prometheus Busybox Docker base images           2                    [OK]
ggtools/busybox-ubuntu   Busybox ubuntu version with extra goodies       0                    [OK]

能看到 AUTOMATED 都是 OK

 

is-official 的栗子

搜索 star 数量>3 且是官方版本的 busybox 镜像

docker search --filter is-official=true --filter stars=3 busybox                                                  
NAME      DESCRIPTION           STARS     OFFICIAL   AUTOMATED
busybox   Busybox base image.   2272      [OK]

能看到 OFFICIAL 是 OK

相关文章

最近一直在开发Apworks框架的案例代码,同时也在一起修复Apw...
最近每天都在空闲时间努力编写Apworks框架的案例代码WeText。...
在《Kubernetes中分布式存储Rook-Ceph部署快速演练》文章中,...
最近在项目中有涉及到Kubernetes的分布式存储部分的内容,也...
CentOS下Docker与.netcore(一) 之 安装 CentOS下Docker与.ne...
CentOS下Docker与.netcore(一) 之 安装 CentOS下Docker与.ne...