How to list all tags for a Docker image on a remote registry?

I'd like to know how to list all tags of a Docker image on a remote Docker registry using the CLI (preferred) or curl? Preferably without pulling all versions from the remote registry, I just want to list the tags.


I got the answer from here . Thanks a lot! :)

Just one-line-script:(find all the tags of debian)

wget -q -O -  | sed -e 's/[][]//g' -e 's/"//g' -e 's/ //g' | tr '}' '\n'  | awk -F: '{print $3}'

UPDATE Thanks for @degelf's advice. Here is the shell script.


if [ $# -lt 1 ]
cat << HELP

dockertags  --  list all tags for a Docker image on a remote registry.

    - list all tags for ubuntu:
       dockertags ubuntu

    - list all php tags containing apache:
       dockertags php apache


tags=`wget -q${image}/tags -O -  | sed -e 's/[][]//g' -e 's/"//g' -e 's/ //g' | tr '}' '\n'  | awk -F: '{print $3}'`

if [ -n "$2" ]
    tags=` echo "${tags}" | grep "$2" `

echo "${tags}"

You can just create a new file name, dockertags, under /usr/local/bin (or add a PATH env to your .bashrc/.zshrc), and put that code in it. Then add the executable permissions(chmod +x dockertags).


dockertags ubuntu ---> list all tags of ubuntu

dockertags php apache ---> list all php tags php containing 'apache'

As of Docker Registry V2, a simple GET suffice:

GET /v2/<name>/tags/list

See docs for more.

I've managed to get it working using curl:

curl -u <username>:<password><username>/<image_name>/tags

Note that image_name should not contain user details etc. For example if you're pushing image named then image_name should be x.

If you want to use the docker registry v2 API, it lists tags by pages. To list all the tags of an image, you may would like to add a large page_size parameter to the url, e.g.

curl -L -s ''|jq '."results"[]["name"]'

The Docker V2 API requires an OAuth bearer token with the appropriate claims. In my opinion, the official documentation is rather vague on the topic. So that others don't go through the same pain I did, I offer the below docker-tags function.

The most recent version of docker-tags can be found in my GitHubGist : "List Docker Image Tags using bash".

The docker-tags function has a dependency on jq. If you're playing with JSON, you likely already have it.

#!/usr/bin/env bash
docker-tags() {

    for item in "${arr[@]}";
        data=("" "scope=repository:$item:pull")
        token="$(curl --silent --get --data-urlencode ${data[0]} --data-urlencode ${data[1]} $tokenUri | jq --raw-output '.token')"
        authz="Authorization: Bearer $token"
        result="$(curl --silent --get -H "Accept: application/json" -H "Authorization: Bearer $token" $listUri | jq --raw-output '.')"
        echo $result


docker-tags "microsoft/nanoserver" "microsoft/dotnet" "library/mongo" "library/redis"

Admittedly, docker-tags makes several assumptions. Specifically, the OAuth request parameters are mostly hard coded. A more ambitious implementation would make an unauthenticated request to the registry and derive the OAuth parameters from the unauthenticated response.

See CLI utility:

Allows enumeration of tags and images.

docker-browse tags <image> will list all tags for the image. e.g. docker-browse tags library/alpine

docker-browse images will list all images in the registry. Not currently available for

You may connect it to any registry, including your private one, so long as it supports Docker Registry HTTP API V2

Building on Yan Foto's answer (the v2 api), I created a simple Python script to list the tags for a given image.


./ alpine


  "name": "library/alpine",
  "tags": [

If the JSON parsing tool, jq is available

wget -q -O - | \
    jq -r .[].name

You can also use this scrap :

# vim /usr/sbin/docker-tags 

& Append Following (as it is):

[[ -z "$im" ]] && { echo -e '\e[31m[-]\e[39m Where is the image name ??' ; exit ; }
[[ -z "$(echo "$im"| grep -o '/')" ]] && { link="$im/tags/" ; } || { link="$im/tags/" ; }
resp="$(curl -sL "$link")"
err="$(echo "$resp" | grep -o 'Page Not Found')"
if [[ ! -z "$err" ]] ; then
    echo -e "\e[31m[-]\e[39m No Image Found with name => [ \e[32m$im\e[39m ]"
    tags="$(echo "$resp"|sed  -e 's|}|\n|g' -e 's|{|\n|g'|grep '"result"'|sed -e 's|,|\n|g'|cut -d '[' -f2|cut -d ']' -f1|sed  '/"tags":/d'|sed -e 's|"||g')"
    echo -e "\e[32m$tags\e[39m"

Make it Executable :

# chmod 755 /usr/sbin/docker-tags

Then Finally Try By :

$ docker-tags testexampleidontexist
   [-] No Image Found with name => [ testexampleidontexist ]

$ docker search ubuntu

$ docker-tags teamrock/ubuntu

[ Hope you are aware of $ & # before running any command ]

Here's a Powershell script I wrote for Windows. Handles v1 and v2 repos:


param (
  [Parameter (Mandatory=$true)]$ImageName,
  [Parameter (Mandatory=$false)]$RegistryURL

if (!$RegistryURL) 
  $RegistryURL = ""

$list = ""
if ($RegistryURL -like "*v2*") 
  $list = "/list"

$URL = "$RegistryURL/$ImageName/tags$list"

write-debug $URL
$resp = Invoke-WebRequest -UseBasicParsing $URL | ConvertFrom-Json

if ($RegistryURL -like "*v2*") 
  $tags = $resp | select tags
} else {
  $tags = $resp | select name

curl -u <username>:<password> https://$your_registry/v2/$image_name/tags/list -s -o - | \
    tr -d '{' | tr -d '}' | sed -e 's/[][]//g' -e 's/"//g' -e 's/ //g' | \
    awk -F: '{print $3}' | sed -e 's/,/\n/g'

You can use it if your env has no 'jq', = )

Get all tags from Docker Hub: this command uses the command-line JSON processor jq to select the tag names from the JSON returned by the Docker Hub Registry (the quotes are removed with tr). Replace library with the Docker Hub user name, debian with the image name:

curl -s '' | jq -r '."results"[]["name"]'

The Docker Registry API has an endpoint to list all tags.

Looks like Tutum has a similar endpoint, as well as a way to access via tutum-cli.

With the tutum-cli, try the following:

tutum tag list <uuid>

I have done this thing when I have to implement a task in which if user somehow type the wrong tag then we have to give the list of all the tag present in the repo(Docker repo) present in the register. So I have code in batch Script.

<pre style="background-color:#bcbbbb;">
@echo off

docker login --username=xxxx --password=xxxx
docker pull %1:%2

echo "Specified Version is Not Found "
echo "Available Version for this image is :"
for /f %%i in (' curl -s -H "Content-Type:application/json" -X POST -d "{\"username\":\"user\",\"password\":\"password\"}" ^|jq -r .token ') do set TOKEN=%%i
curl -sH "Authorization: JWT %TOKEN%" "" | jq .results[].name

So in this we can give arguments to out batch file like:

Dockerfile java version7 

To view all available tags in a browser:<username>/<image_name>/tags


Or, you can get a json response using this endpoint:

You can achieve by running on terminal this:

curl -L -s '' | jq . | grep name

Also, if you don't have jq you have to install it by

sudo apt-get install jq

This is a build in functionality of docker:

docker images

Results in

REPOSITORY                                  TAG                 IMAGE ID            CREATED             SIZE       3.0.1               f60f49fba3e0        2 months ago        148MB

Need Your Help

Including hash values in ASP.NET MVC URL routes routes

I need to implement hash value i.e the Url should look like this:

Remove white space below image

css image whitespace border removing-whitespace

In Firefox only my video thumbnails are displaying mysterious 2-3 pixels of white space between the bottom of my image and its border (see below).