Skip to content

specious/dockertags

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

dockertags - Universal Docker Registry Tag Fetcher

A strict-mode Bash tool to fetch image tags from Docker Hub, GHCR, Quay.io, GCR, and Kubernetes registries with a single, intuitive interface.

Purpose

dockertags solves the registry fragmentation problem - different container registries have different APIs, endpoints, authentication, and response formats. Instead of maintaining 5+ specialized scripts or fighting curl/jq pipelines, get a single command that works across all major registries.

For: DevOps engineers, Kubernetes operators, CI/CD builders, and anyone tired of copy-pasting registry-specific curl commands.

Features

  • Multi-registry support - Docker Hub, GHCR, Quay.io, GCR, registry.k8s.io
  • Docker Hub account listing - dockertags grafana → lists loki, prometheus, etc.
  • Official image detection - dockertags nodelibrary/node/tags/ automatically
  • Strict mode - set -euo pipefail, no silent failures
  • Config-driven - registry quirks in lookup tables, core logic clean
  • Semver filtering - --latest shows only production tags
  • Pagination control - --page-size=N

Installation

curl -sL https://raw.githubusercontent.com/specious/dockertags/main/dockertags > /usr/local/bin/dockertags
chmod +x /usr/local/bin/dockertags

Requirements: curl + jq

Usage

dockertags [OPTIONS] IMAGE

Options

-q, --quiet        Suppress pagination notices
-l, --latest       Show latest/semver tags only
--page-size=N      API page size (default: 100)
-v, --version      Show version
-h, --help         Show this help
DEBUG=1            Debug mode

Examples

Docker Hub

dockertags node                    # Official image → library/node/tags/
dockertags busybox                 # Official image → library/busybox/tags/
dockertags grafana                 # Account → lists repositories
dockertags grafana/loki            # Tags → 3.2.1, 3.1.0, latest
dockertags docker.io/grafana/loki  # Fully qualified

Other Registries

dockertags quay.io/keycloak/keycloak           # Quay tags
dockertags gcr.io/cloud-builders/docker        # GCR tags
dockertags registry.k8s.io/kube-proxy          # K8s tags
dockertags ghcr.io/hadolint/hadolint           # GHCR (needs token)

Advanced

dockertags --page-size=50 grafana/loki    # Smaller pages
dockertags -l grafana/loki                # Semver only
dockertags -q node                        # No pagination notice
DEBUG=1 dockertags grafana                # Debug mode

Registry Status

Registry Account Listing Tags Notes
docker.io grafana Full support
quay.io JSON Accept header
gcr.io OCI standard
registry.k8s.io -L redirects
ghcr.io ⚠️ Needs OAuth token

How It Works

  1. Single config table - REGISTRY_URL[$registry] with %s%s format (repo,page_size)
  2. Strict parsers - REGISTRY_PARSER[$registry] - no fallbacks
  3. Smart account detection (for docker.io) - Single names look up repositories under the account
  4. Official image auto-detection (for docker.io) - alpine fetches library/alpine

Configuration

Easy to extend - add new registries by extending these two arrays:

REGISTRY_URL["newreg.io"]="https://newreg.io/v2/%s/tags/list?n=%s"
REGISTRY_PARSER["newreg.io"]='.tags[] | select(. != null)'

Status

Production-ready for Docker Hub, Quay, GCR, K8s. GHCR needs token auth (OAuth2 flow WIP).

License

ISC License - Copyright (c) 2026 Ildar Sagdejev

About

Universal container registry tag fetcher

Topics

Resources

Stars

Watchers

Forks

Contributors

Languages