这会在 Docker Hub 中搜索包含关键字 ubuntu 的镜像,并以指定格式显示镜像名称和 star 数。
实例
1、搜索 Ubuntu 镜像
docker search ubuntu
输出示例:
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
ubuntu Ubuntuis a Debian-based Linux operating sys…10000[OK]
dorowu/ubuntu-desktop-lxde-vnc Ubuntuwith openssh-server andNoVNC4000[OK]
rastasheep/ubuntu-sshd Dockerized SSH service, built on top of offi…2000[OK]
参数说明:
NAME: 镜像仓库源的名称
DESCRIPTION: 镜像的描述
OFFICIAL: 是否 docker 官方发布
stars: 类似 Github 里面的 star,表示点赞、喜欢的意思。
AUTOMATED: 自动构建。
2、限制返回结果数量
docker search --limit 3 ubuntu
输出示例:
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
ubuntu Ubuntuis a Debian-based Linux operating sys…10000[OK]
dorowu/ubuntu-desktop-lxde-vnc Ubuntuwith openssh-server andNoVNC4000[OK]
rastasheep/ubuntu-sshd Dockerized SSH service, built on top of offi…2000[OK]
3、过滤搜索结果
docker search --filter stars=1000 ubuntu
输出示例:
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
ubuntu Ubuntuis a Debian-based Linux operating sys…10000[OK]
dorowu/ubuntu-desktop-lxde-vnc Ubuntuwith openssh-server andNoVNC4000[OK]
rastasheep/ubuntu-sshd Dockerized SSH service, built on top of offi…2000[OK]