Sign inSign up

willluck/pkgbadge

By willluck

Updated 5 months ago

Self-hosted badge server for GitHub Container Registry

Image
0

465

willluck/pkgbadge repository overview

pkgbadge

CI Release Licence Docker Pulls

Self-hosted badge server for GitHub Container Registry. Scrapes GHCR package pages and serves shields.io endpoint badges with pull counts, versions, image sizes, and platform info.

Features

  • Pull count, version, image size, and architecture badges for any public GHCR package
  • Shields.io endpoint badge compatible JSON responses
  • Background scraping on a configurable interval (default 6h)
  • Supports packages where the repo name differs from the package name
  • Zero external dependencies, Go stdlib only
  • Distroless container image
  • Graceful shutdown (SIGINT/SIGTERM)
  • 1-hour client-side cache headers

Quick Start

Docker CLI
docker run -d \
  --name pkgbadge \
  --restart unless-stopped \
  -p 8080:8080 \
  -e PKGBADGE_PACKAGES="owner/repo,owner/repo/package" \
  ghcr.io/will-luck/pkgbadge:latest
Docker Compose
services:
  pkgbadge:
    image: ghcr.io/will-luck/pkgbadge:latest
    ports:
      - "8080:8080"
    environment:
      PKGBADGE_PACKAGES: "owner/repo,owner/repo/package"
    restart: unless-stopped

Then add badges to your README:

![GHCR Pulls](https://img.shields.io/endpoint?url=https://your-host/owner/package/pulls.json)
![Version](https://img.shields.io/endpoint?url=https://your-host/owner/package/version.json)

Badge Types

BadgeEndpointExample
Pull count/owner/package/pulls.json1.5k
Version/owner/package/version.json2.11.1
Image size/owner/package/size.json12.4 MB
Platforms/owner/package/arch.jsonamd64 | arm64

Configuration

VariableDefaultDescription
PKGBADGE_PACKAGES(required)Comma-separated packages to scrape
PKGBADGE_INTERVAL6hScrape interval (Go duration format)
PKGBADGE_PORT8080HTTP listen port

Package format is owner/package when the repo and package names match, or owner/repo/package when they differ (e.g. Will-Luck/Docker-Sentinel/docker-sentinel).

See the wiki for detailed configuration and usage guides.

Documentation

See the Wiki for:

Licence

MIT

Tag summary

Content type

Image

Digest

sha256:8d380d3ee

Size

3.4 MB

Last updated

5 months ago

docker pull willluck/pkgbadge