#!/bin/sh
repo_url=https://registry.hub.docker.com/v1/repositories
image_name=$1
curl -s ${repo_url}/${image_name}/tags | json_reformat | grep name | awk '{print $2}' | sed -e 's/"//g'
测试
bash script.sh dockermxw/nginx
本文介绍了一个用于查询Docker Hub中指定镜像标签的bash脚本。通过使用curl命令结合其他文本处理工具,该脚本能够获取并展示指定Docker镜像的所有可用标签。
#!/bin/sh
repo_url=https://registry.hub.docker.com/v1/repositories
image_name=$1
curl -s ${repo_url}/${image_name}/tags | json_reformat | grep name | awk '{print $2}' | sed -e 's/"//g'
测试
bash script.sh dockermxw/nginx
1800

被折叠的 条评论
为什么被折叠?