A lightweight Go API that queries container registries (Docker Hub, GHCR, etc.) to expose raw Docker/OCI registry data. Acts as a proxy so your client application can handle caching, version parsing, and business logic.
services:
registry-api:
image: ghcr.io/slimani-dev/registry-api:main
container_name: registry-api
restart: unless-stopped
ports:
- "8080:8080"
environment:
- REDIS_ADDR=redis:6379
depends_on:
redis:
condition: service_healthy
redis:
image: redis:alpine
container_name: registry-api-redis
restart: unless-stopped
volumes:
- redis-data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 3
volumes:
redis-data:
docker compose up -d
The API will be available at http://localhost:8080.
Mount your Docker config to allow pulling from authenticated registries:
services:
registry-api:
volumes:
- ~/.docker/config.json:/root/.docker/config.json:ro
git clone https://github.com/slimani-dev/registry-api.git
cd registry-api
docker compose up -d --build
GET /tags โ List TagsLists all available tags for a given repository.
curl "http://localhost:8080/tags?image=ghcr.io/immich-app/immich-server"
{
"image": "ghcr.io/immich-app/immich-server",
"tags": ["latest", "v1.104.0", "v1.103.1"]
}
GET /digest โ Get Exact DigestFast HEAD request to get the manifest digest.
curl "http://localhost:8080/digest?image=ghcr.io/immich-app/immich-server&reference=v1.104.0"
{
"image": "ghcr.io/immich-app/immich-server",
"reference": "v1.104.0",
"digest": "sha256:e6a6298e..."
}
GET /config โ Image ConfigurationReturns Env, Cmd, Labels, ExposedPorts, etc.
curl "http://localhost:8080/config?image=ghcr.io/immich-app/immich-server&reference=latest"
GET /manifest โ Raw ManifestReturns the raw OCI/Docker manifest with layer sizes.
curl "http://localhost:8080/manifest?image=ghcr.io/immich-app/immich-server&reference=v1.104.0"
GET /index โ Multi-Architecture IndexReturns the multi-arch manifest list. Returns 404 if single-architecture.
curl "http://localhost:8080/index?image=ghcr.io/immich-app/immich-server&reference=latest"
GET /latest โ Expanded HelperFinds newest tag, fetches digest, and pulls summary metadata.
curl "http://localhost:8080/latest?image=ghcr.io/immich-app/immich-server"
GET /health โ Health Checkcurl "http://localhost:8080/health"
{ "status": "ok", "redis": "connected" }
The API uses Redis to automatically learn which images are slow and adapts its behavior:
| Image Type | Behavior |
|---|---|
Fast (e.g. immich-server, ~400 tags) | Always fresh from registry |
Slow (e.g. immich-machine-learning, ~140k tags) | Cached response in ~20ms, background refresh |
How it works:
| Setting | Value |
|---|---|
| Cache TTL | 72 hours |
| Slow flag TTL | 30 days |
| Slow threshold | 10 seconds |
Cached responses include X-From-Cache: true header so your client knows.
โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโ
โ Client โโโโโโถโ Registry API โโโโโโถโ Redis Cache โ
โ (PHP/curl) โโโโโโโ (Go, port 8080) โโโโโโโ (alpine) โ
โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโ
โ GHCR / Docker โ
โ Hub / Quay.io โ
โโโโโโโโโโโโโโโโโโโโ
| Variable | Default | Description |
|---|---|---|
REDIS_ADDR | redis:6379 | Redis connection address |
Go
96.4%
Dockerfile
3.6%
A lightweight Go API that queries container registries (Docker Hub, GHCR, etc.) to expose raw Docker/OCI registry data. Acts as a proxy so your client application can handle caching, version parsing, and business logic.
services:
registry-api:
image: ghcr.io/slimani-dev/registry-api:main
container_name: registry-api
restart: unless-stopped
ports:
- "8080:8080"
environment:
- REDIS_ADDR=redis:6379
depends_on:
redis:
condition: service_healthy
redis:
image: redis:alpine
container_name: registry-api-redis
restart: unless-stopped
volumes:
- redis-data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 3
volumes:
redis-data:
docker compose up -d
The API will be available at http://localhost:8080.
Mount your Docker config to allow pulling from authenticated registries:
services:
registry-api:
volumes:
- ~/.docker/config.json:/root/.docker/config.json:ro
git clone https://github.com/slimani-dev/registry-api.git
cd registry-api
docker compose up -d --build
GET /tags โ List TagsLists all available tags for a given repository.
curl "http://localhost:8080/tags?image=ghcr.io/immich-app/immich-server"
{
"image": "ghcr.io/immich-app/immich-server",
"tags": ["latest", "v1.104.0", "v1.103.1"]
}
GET /digest โ Get Exact DigestFast HEAD request to get the manifest digest.
curl "http://localhost:8080/digest?image=ghcr.io/immich-app/immich-server&reference=v1.104.0"
{
"image": "ghcr.io/immich-app/immich-server",
"reference": "v1.104.0",
"digest": "sha256:e6a6298e..."
}
GET /config โ Image ConfigurationReturns Env, Cmd, Labels, ExposedPorts, etc.
curl "http://localhost:8080/config?image=ghcr.io/immich-app/immich-server&reference=latest"
GET /manifest โ Raw ManifestReturns the raw OCI/Docker manifest with layer sizes.
curl "http://localhost:8080/manifest?image=ghcr.io/immich-app/immich-server&reference=v1.104.0"
GET /index โ Multi-Architecture IndexReturns the multi-arch manifest list. Returns 404 if single-architecture.
curl "http://localhost:8080/index?image=ghcr.io/immich-app/immich-server&reference=latest"
GET /latest โ Expanded HelperFinds newest tag, fetches digest, and pulls summary metadata.
curl "http://localhost:8080/latest?image=ghcr.io/immich-app/immich-server"
GET /health โ Health Checkcurl "http://localhost:8080/health"
{ "status": "ok", "redis": "connected" }
The API uses Redis to automatically learn which images are slow and adapts its behavior:
| Image Type | Behavior |
|---|---|
Fast (e.g. immich-server, ~400 tags) | Always fresh from registry |
Slow (e.g. immich-machine-learning, ~140k tags) | Cached response in ~20ms, background refresh |
How it works:
| Setting | Value |
|---|---|
| Cache TTL | 72 hours |
| Slow flag TTL | 30 days |
| Slow threshold | 10 seconds |
Cached responses include X-From-Cache: true header so your client knows.
โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโ
โ Client โโโโโโถโ Registry API โโโโโโถโ Redis Cache โ
โ (PHP/curl) โโโโโโโ (Go, port 8080) โโโโโโโ (alpine) โ
โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโ
โ GHCR / Docker โ
โ Hub / Quay.io โ
โโโโโโโโโโโโโโโโโโโโ
| Variable | Default | Description |
|---|---|---|
REDIS_ADDR | redis:6379 | Redis connection address |
Go
96.4%
Dockerfile
3.6%