# 获取仓库类的镜像
curl -XGET http://192.168.1.8:5000/v2/_catalog

# 获取某个镜像的标签列表
curl -XGET http://192.168.1.8:5000/v2/image_name/tags/list

# 查看Docker镜像仓库中镜像的所有标签
# 实现方法就是通过镜像仓库的 restful API,来查询,然后把返回的 json 结果简单处理一下,然后打印出来。
#!/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'

相关文章:

  • 2021-10-11
  • 2021-03-12
  • 2022-01-04
  • 2021-11-11
  • 2021-11-21
  • 2021-04-28
  • 2022-02-11
  • 2021-09-18
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-06-01
  • 2021-11-21
  • 2022-12-23
相关资源
相似解决方案