When working with Docker images, sometimes you need to know which tags are available for a given image in a remote registry like Docker Hub, Amazon ECR, or a private registry. For example, you might want to pull the latest stable version of an image or check if a specific tag exists.
Unfortunately, Docker CLI does not provide a direct docker image list remote command. But there are several ways to fetch available tags.
1️⃣ Listing Tags from Docker Hub (Official Images)
You can use the Docker Hub Registry HTTP API.
Example: to list all tags for the nginx image:
curl -s https://registry.hub.docker.com/v2/repositories/library/nginx/tags/ | jq '."results"[]["name"]'
library/nginx→ official nginx image namespacejq→ formats the JSON output
This will return something like:
"1.23"
"1.23.1"
"1.24"
"latest"
👉 Without jq, you’ll get raw JSON.
2️⃣ Listing Tags for Docker Hub (User/Org Images)
For user/org images, replace library with the namespace.
Example:
curl -s https://registry.hub.docker.com/v2/repositories/myusername/myimage/tags/ | jq '."results"[]["name"]'
3️⃣ Using skopeo (Recommended Tool)
skopeo is a handy CLI tool that can query container registries.
Example:
skopeo list-tags docker://nginx
Output:
{
"Repository": "nginx",
"Tags": [
"1.23",
"1.24",
"latest"
]
}
✅ Works with Docker Hub, Quay, GCR, ECR, private registries, etc.
4️⃣ For Private Registries
If you are using a private registry (self-hosted or corporate):
curl -s https://myregistry.example.com/v2/myimage/tags/list | jq
If authentication is required, you may need to pass credentials:
curl -u username:password https://myregistry.example.com/v2/myimage/tags/list | jq
5️⃣ Limitations
- Docker Hub API results are paginated (default: 10 per request).
To fetch all tags, add?page_size=100(max 100):curl -s "https://registry.hub.docker.com/v2/repositories/library/nginx/tags?page_size=100" | jq - Private registries may require additional headers or tokens.
📌 Summary
- Docker CLI cannot list remote tags directly.
- Use Docker Hub API (
/v2/repositories/.../tags/). - Use skopeo for a cleaner cross-registry solution.
- For private registries, query
v2/<image>/tags/list.
👉 If you frequently need to check tags, skopeo is the most convenient option.