I'd like to know how to list all tags of a Docker image on a remote Docker registry (tutum in our case but I don't suppose it matters) using the CLI (preferred) or curl? Preferably without pulling all versions from the remote registry, I just want to list the tags.
相关问题
- Docker task in Azure devops won't accept "$(pw
- Unable to run mariadb when mount volume
- Unspecified error (0x80004005) while running a Doc
- What would prevent code running in a Docker contai
- How to reload apache in php-apache docker containe
Get all tags from Docker Hub: this command uses the command-line
JSON
processorjq
to select the tag names from theJSON
returned by the Docker Hub Registry (the quotes are removed withtr
). Replace library with the Docker Hub user name, debian with the image name: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.
So in this we can give arguments to out batch file like:
As of Docker Registry V2, a simple
GET
suffice:See docs for more.
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:
Here's a Powershell script I wrote for Windows. Handles v1 and v2 repos:
Get-DockerImageVersions.ps1:
I got the answer from here . Thanks a lot! :)
Just one-line-script:(find all the tags of debian)
UPDATE Thanks for @degelf's advice. Here is the shell script.
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
).Usage:
dockertags ubuntu
---> list all tags of ubuntudockertags php apache
---> list all php tags php containing 'apache'