API to query Docker registries to list image tags.
695
This project aims to provide a simple to use API to list docker tags among different providers.
This project is also publicly hosted and available on https://api.gerwim.com/dockertags/
The API requires two headers:
registry and imageName. A third option, searchRegex is optional and will return matching tags.
| Header | Required | Value |
|---|---|---|
| registry | True | string |
| imageName | True | string |
| searchRegex | False | string |
curl 'https://api.gerwim.com/dockertags/v1/tags' \
--header 'registry: hub.docker.com' \
--header 'imageName: ubuntu'
18.curl 'https://api.gerwim.com/dockertags/v1/tags' \
--header 'registry: hub.docker.com' \
--header 'imageName: ubuntu' \
--header 'searchRegex: ^18\.'
returns
{
"name": "ubuntu",
"tags": [
"18.04",
"18.10"
]
}
windowsservercorecurl 'https://api.gerwim.com/dockertags/v1/tags' \
--header 'registry: mcr.microsoft.com' \
--header 'imageName: dotnet/framework/aspnet' \
--header 'searchRegex: ^4\.8-windowsservercore-(\d{4}|ltsc\d{4})'
returns
{
"name": "dotnet/framework/aspnet",
"tags": [
"4.8-windowsservercore-1803",
"4.8-windowsservercore-1903",
"4.8-windowsservercore-1909",
"4.8-windowsservercore-2004",
"4.8-windowsservercore-2009",
"4.8-windowsservercore-ltsc2016",
"4.8-windowsservercore-ltsc2019"
]
}
The docker image is publicly available on DockerHub.
By default, the results are cached in memory for 86400 seconds (24 hours; to override, set the environment variable Cache__ExpirationTtl to a different value).
However, there's also support for the Cloudflare KV store. To use this, set the following environment variables:
Cloudflare__KVUrl = https://api.cloudflare.com/client/v4/accounts/ACCOUNTID/storage/kv/namespaces/NAMESPACEID
Cloudflare__ApiToken = xxxx
If you want to run it with the default settings (in memory cache):
docker run -it --rm -p 80:80 gerwim/dockertagsapi:latest
Content type
Image
Digest
sha256:bff1b223c…
Size
84 MB
Last updated
over 2 years ago
docker pull gerwim/dockertagsapi