• Home
  • Docker
  • 通过Dockerhub的官方API查找官方镜像的历史版本
通过Dockerhub的官方API查找官方镜像的历史版本
By FreelyTomorrow profile image FreelyTomorrow
1 min read

通过Dockerhub的官方API查找官方镜像的历史版本

一键查找官方镜像的历史版本

命令

curl -L -s "https://registry.hub.docker.com/v2/repositories/library/$1/tags?page_size=1024" | jq '.results[]["name"]' | sed 's/\"//g' | sort -u

用法

可以将上面的命令写成一个shell脚本,运行脚本来查找。
如:

[root@wordpress-187 /opt/ShellScripts]#./search-tag.sh centos
5
5.11
6
6.10
6.6
6.7
6.8
6.9
7
7.0.1406
7.1.1503
7.2.1511
7.3.1611
7.4.1708
7.5.1804
7.6.1810
7.7.1908
7.8.2003
7.9.2009
8
8.1.1911
8.2.2004
8.3.2011
8.4.2105
centos5
centos5.11
centos6
centos6.10
centos6.6
centos6.7
centos6.8
centos6.9
centos7
centos7.0.1406
centos7.1.1503
centos7.2.1511
centos7.3.1611
centos7.4.1708
centos7.5.1804
centos7.6.1810
centos7.7.1908
centos7.8.2003
centos7.9.2009
centos8
centos8.1.1911
centos8.2.2004
centos8.3.2011
centos8.4.2105
latest
By FreelyTomorrow profile image FreelyTomorrow
Updated on
Docker Shell脚本