# 3.3 搜寻镜像(search)

使用<mark style="color:blue;">**docker search**</mark>命令可以搜索Docker Hub官方仓库中的镜像。语法为<mark style="color:blue;">**docker search \[option] keyword**</mark>。支持的命令选项主要包括：

* -f, --filter filter：过滤输出内容
* \--format string：格式化输出内容
* \--limit int：限制输出结果个数，默认为25个；
* \--no-trunc：不截断输出结果

例如，搜索官方提供的带nginx关键字的镜像，如下所示：

```bash
$ docker search -f is-official=true nginx
NAME      DESCRIPTION                                      STARS     OFFICIAL   AUTOMATED
nginx     Official build of Nginx.                         19129     [OK]       
unit      Official build of NGINX Unit: Universal Web …   15        [OK] 
```

{% hint style="info" %}
默认的输出结果将按照星级评价进行排序。
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://bohans.gitbook.io/devops/ji-chu-zhi-shi/3.-docker-jing-xiang/3.3-sou-xun-jing-xiang-search.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
