slimani-dev/registry-api

Go

1

3 commits

updated Jun 2, 2026

See the code

See what people are saying

SourceMessageScoreDate

Remember the homelab dashboard I posted 4 months ago? It's finally open source (beta) (r/selfhosted)

A few months ago I posted [Building My Own Homelab Dashboard](https://www.reddit.com/r/selfhosted/s/2JKFg6SRP6) and a lot of you asked for the repo. Sorry it took longer than "a few weeks" ๐Ÿ˜… but it's out now as a beta: **https://github.com/slimani-dev/muraqib** Quick recap for anyone who missedโ€ฆ

0

Sep 30, 2026

README

๐Ÿณ Docker Registry API

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.


Quick Start

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.

For Private Registries

Mount your Docker config to allow pulling from authenticated registries:

services:
  registry-api:
    volumes:
      - ~/.docker/config.json:/root/.docker/config.json:ro

Building from Source

git clone https://github.com/slimani-dev/registry-api.git
cd registry-api
docker compose up -d --build

Endpoints

1. GET /tags โ€” List Tags

Lists 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"]
}

2. GET /digest โ€” Get Exact Digest

Fast 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..."
}

3. GET /config โ€” Image Configuration

Returns Env, Cmd, Labels, ExposedPorts, etc.

curl "http://localhost:8080/config?image=ghcr.io/immich-app/immich-server&reference=latest"

4. GET /manifest โ€” Raw Manifest

Returns the raw OCI/Docker manifest with layer sizes.

curl "http://localhost:8080/manifest?image=ghcr.io/immich-app/immich-server&reference=v1.104.0"

5. GET /index โ€” Multi-Architecture Index

Returns the multi-arch manifest list. Returns 404 if single-architecture.

curl "http://localhost:8080/index?image=ghcr.io/immich-app/immich-server&reference=latest"

6. GET /latest โ€” Expanded Helper

Finds newest tag, fetches digest, and pulls summary metadata.

curl "http://localhost:8080/latest?image=ghcr.io/immich-app/immich-server"

7. GET /health โ€” Health Check

curl "http://localhost:8080/health"
{ "status": "ok", "redis": "connected" }

Smart Caching

The API uses Redis to automatically learn which images are slow and adapts its behavior:

Image TypeBehavior
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:

  1. Every request is fetched from the registry and timed
  2. If a request takes longer than 10 seconds, the image is flagged as "slow"
  3. Future requests for slow images return cached data instantly and trigger a silent background refresh
  4. Fast images are never served from cache โ€” always fresh
SettingValue
Cache TTL72 hours
Slow flag TTL30 days
Slow threshold10 seconds

Cached responses include X-From-Cache: true header so your client knows.


Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚   Client     โ”‚โ”€โ”€โ”€โ”€โ–ถโ”‚  Registry API    โ”‚โ”€โ”€โ”€โ”€โ–ถโ”‚  Redis Cache  โ”‚
โ”‚  (PHP/curl)  โ”‚โ—€โ”€โ”€โ”€โ”€โ”‚  (Go, port 8080) โ”‚โ—€โ”€โ”€โ”€โ”€โ”‚  (alpine)     โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                            โ”‚
                            โ–ผ
                    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                    โ”‚  GHCR / Docker   โ”‚
                    โ”‚  Hub / Quay.io   โ”‚
                    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Environment Variables

VariableDefaultDescription
REDIS_ADDRredis:6379Redis connection address

slimani-dev/registry-api

Go

1

3 commits

updated Jun 2, 2026

See the code

See what people are saying

SourceMessageScoreDate

Remember the homelab dashboard I posted 4 months ago? It's finally open source (beta) (r/selfhosted)

A few months ago I posted [Building My Own Homelab Dashboard](https://www.reddit.com/r/selfhosted/s/2JKFg6SRP6) and a lot of you asked for the repo. Sorry it took longer than "a few weeks" ๐Ÿ˜… but it's out now as a beta: **https://github.com/slimani-dev/muraqib** Quick recap for anyone who missedโ€ฆ

0

Sep 30, 2026

README

๐Ÿณ Docker Registry API

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.


Quick Start

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.

For Private Registries

Mount your Docker config to allow pulling from authenticated registries:

services:
  registry-api:
    volumes:
      - ~/.docker/config.json:/root/.docker/config.json:ro

Building from Source

git clone https://github.com/slimani-dev/registry-api.git
cd registry-api
docker compose up -d --build

Endpoints

1. GET /tags โ€” List Tags

Lists 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"]
}

2. GET /digest โ€” Get Exact Digest

Fast 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..."
}

3. GET /config โ€” Image Configuration

Returns Env, Cmd, Labels, ExposedPorts, etc.

curl "http://localhost:8080/config?image=ghcr.io/immich-app/immich-server&reference=latest"

4. GET /manifest โ€” Raw Manifest

Returns the raw OCI/Docker manifest with layer sizes.

curl "http://localhost:8080/manifest?image=ghcr.io/immich-app/immich-server&reference=v1.104.0"

5. GET /index โ€” Multi-Architecture Index

Returns the multi-arch manifest list. Returns 404 if single-architecture.

curl "http://localhost:8080/index?image=ghcr.io/immich-app/immich-server&reference=latest"

6. GET /latest โ€” Expanded Helper

Finds newest tag, fetches digest, and pulls summary metadata.

curl "http://localhost:8080/latest?image=ghcr.io/immich-app/immich-server"

7. GET /health โ€” Health Check

curl "http://localhost:8080/health"
{ "status": "ok", "redis": "connected" }

Smart Caching

The API uses Redis to automatically learn which images are slow and adapts its behavior:

Image TypeBehavior
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:

  1. Every request is fetched from the registry and timed
  2. If a request takes longer than 10 seconds, the image is flagged as "slow"
  3. Future requests for slow images return cached data instantly and trigger a silent background refresh
  4. Fast images are never served from cache โ€” always fresh
SettingValue
Cache TTL72 hours
Slow flag TTL30 days
Slow threshold10 seconds

Cached responses include X-From-Cache: true header so your client knows.


Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚   Client     โ”‚โ”€โ”€โ”€โ”€โ–ถโ”‚  Registry API    โ”‚โ”€โ”€โ”€โ”€โ–ถโ”‚  Redis Cache  โ”‚
โ”‚  (PHP/curl)  โ”‚โ—€โ”€โ”€โ”€โ”€โ”‚  (Go, port 8080) โ”‚โ—€โ”€โ”€โ”€โ”€โ”‚  (alpine)     โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                            โ”‚
                            โ–ผ
                    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                    โ”‚  GHCR / Docker   โ”‚
                    โ”‚  Hub / Quay.io   โ”‚
                    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Environment Variables

VariableDefaultDescription
REDIS_ADDRredis:6379Redis connection address

Languages

Go

96.4%

Dockerfile

3.6%