Add --limit option to docker search
This fix tries to address the issue raised in #23055. Currently `docker search` result caps at 25 and there is no way to allow getting more results (if exist). This fix adds the flag `--limit` so that it is possible to return more results from the `docker search`. Related documentation has been updated. Additional tests have been added to cover the changes. This fix fixes #23055. Signed-off-by: Yong Tang <yong.tang.github@outlook.com> Upstream-commit: 92f10fe228c1b4b527b87ac47401132322283ea3 Component: engine
This commit is contained in:
@@ -124,6 +124,7 @@ This section lists each version from latest to oldest. Each listing includes a
|
||||
* `GET /images/json` now supports filters `since` and `before`.
|
||||
* `POST /containers/(id or name)/start` no longer accepts a `HostConfig`.
|
||||
* `POST /images/(name)/tag` no longer has a `force` query parameter.
|
||||
* `GET /images/search` now supports maximum returned search results `limit`.
|
||||
|
||||
### v1.23 API changes
|
||||
|
||||
|
||||
@@ -2130,6 +2130,7 @@ Search for an image on [Docker Hub](https://hub.docker.com).
|
||||
Query Parameters:
|
||||
|
||||
- **term** – term to search
|
||||
- **limit** – maximum returned search results
|
||||
- **filters** – a JSON encoded value of the filters (a map[string][]string) to process on the images list. Available filters:
|
||||
- `stars=<number>`
|
||||
- `is-automated=(true|false)`
|
||||
|
||||
@@ -19,6 +19,7 @@ parent = "smn_cli"
|
||||
- is-official=(true|false)
|
||||
- stars=<number> - image has at least 'number' stars
|
||||
--help Print usage
|
||||
--limit=25 Maximum returned search results
|
||||
--no-trunc Don't truncate output
|
||||
|
||||
Search [Docker Hub](https://hub.docker.com) for images
|
||||
@@ -74,6 +75,12 @@ at least 3 stars and the description isn't truncated in the output:
|
||||
progrium/busybox 50 [OK]
|
||||
radial/busyboxplus Full-chain, Internet enabled, busybox made from scratch. Comes in git and cURL flavors. 8 [OK]
|
||||
|
||||
## Limit search results (--limit)
|
||||
|
||||
The flag `--limit` is the maximium number of results returned by a search. This value could
|
||||
be in the range between 1 and 100. The default value of `--limit` is 25.
|
||||
|
||||
|
||||
## Filtering
|
||||
|
||||
The filtering flag (`-f` or `--filter`) format is a `key=value` pair. If there is more
|
||||
|
||||
Reference in New Issue
Block a user