Docker Community Forums

Share and learn in the Docker community.

How can I list tags for a repository?

I’m trying to use the API to list the tags for DockerHub repositories. We’ll see I’m trying for bkuhl/game-watcher/. Both and /v2/bkuhl/game-watcher/tags/list return 404s (when I’m authenticated). The only documentation on this I can find is located at Though I’m not completely sure this documentation is for DockerHub itself.

How can I list the tags for a repository?

Apparently the URL is as of some random gist I found online. Is there any official documentation for this?

See CLI utility:

Allows enumeration of tags and images.

Does anyone know what is the reason this hasn’t been implemented for the CLI tooling of docker?

Shouldn’t it be something as simple as this?

$ docker image search --list-tags <path/to/repo>

True, I am still wondering how to search on tags, the website is useless two because it has no search and a pagination of ~20 tags, making impossible to find the tag on active repos.

1 Like

and I’m sure it used to have a much more compact view?

But, I agree, its current form is useless. Not ordered, not searchable.

Thank you so much for truly a veritable knowldege.It really worked for me. The key idea behind it is pretty amazing and glad to know about it.

function listTags() {
    local repo=${1}
    local size=${2:-25}
    local page=${3:-1}
    [ -z "${repo}" ] && echo "Usage: listTags <repoName> [size] [pageIndex]" 1>&2 && return 1
    curl "${repo}/tags?page=${page}&page_size=${size}" 2>/dev/null | jq -r '.results[].name' | sort

have a try on this function, you need to install jq first (sudo apt install jq).
example usage:

  • listTags ubuntu
  • listTags ubuntu 10

I extended the code by @zzhouqianq to grab all the tags, doing multiple round-trips to DockerHub when necessary. I hope someone finds it useful.

function listAllTags() { 
    local repo=${1} 
    local page_size=${2:-100} 
    [ -z "${repo}" ] && echo "Usage: listTags <repoName> [page_size]" 1>&2 && return 1 
    local base_url="${repo}/tags" 
    local page=1 
    local res=$(curl "${base_url}?page_size=${page_size}&page=${page}" 2>/dev/null) 
    local tags=$(echo ${res} | jq --raw-output '.results[].name') 
    local all_tags="${tags}" 
    local tag_count=$(echo ${res} | jq '.count')   
    ((page_count=(${tag_count}+${page_size}-1)/${page_size}))  # ceil(tag_count / page_size) 
    for page in $(seq 2 $page_count); do 
        tags=$(curl "${base_url}?page_size=${page_size}&page=${page}" 2>/dev/null | jq --raw-output '.results[].name') 
    echo "${all_tags}" | sort