Docker查看镜像的所有标签

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'

json_reformat 命令不存在

  • Ubuntu
apt install -y yajl-tools
  • centos
yum install -y yajl

note

yajl => yet another json library

posted @ 2022-03-30 17:12  zakun  阅读(606)  评论(0编辑  收藏  举报
返回顶部