【问题标题】:Get tags for docker image without organization获取没有组织的 docker 镜像的标签
【发布时间】:2021-04-12 09:23:28
【问题描述】:

使用docker hub api获取docker镜像的标签:

curl -sL https://hub.docker.com/v2/repositories/<org>/<name>/tags

我将它输入| jq 并提取我需要的内容。

但是有些图像没有组织,例如mariadb.

这些我都试过了:

curl -sL https://hub.docker.com/v2/repositories/mariadb/tags
curl -sL https://hub.docker.com/v2/repositories/_/mariadb/tags
curl -sL https://hub.docker.com/v2/repositories/mariadb/_/tags
curl -sL https://hub.docker.com/v2/repositories/mariadb/mariadb/tags

但是那些给出错误,或者这个:

{"count":0,"next":null,"previous":null,"results":[]}

我该怎么做?

【问题讨论】:

    标签: docker docker-registry dockerhub


    【解决方案1】:

    我找不到这方面的官方文档(你可以吗?),但诀窍是使用魔术字符串 library

    curl -sL https://hub.docker.com/v2/repositories/library/mariadb/tags
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-08-04
      • 1970-01-01
      • 2016-11-22
      • 2018-07-12
      • 2018-08-23
      • 2023-03-30
      • 2019-12-07
      • 1970-01-01
      相关资源
      最近更新 更多