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