Skip to content

Publish container images to GHCR instead of Docker Hub#18

Merged
cjimti merged 1 commit into
masterfrom
17-ghcr-container-registry
Jun 17, 2026
Merged

Publish container images to GHCR instead of Docker Hub#18
cjimti merged 1 commit into
masterfrom
17-ghcr-container-registry

Conversation

@cjimti

@cjimti cjimti commented Jun 17, 2026

Copy link
Copy Markdown
Member

Closes #17.

The v1.2.0 release failed at Login to Docker Hub (Username and password required) because the pipeline pushes to Docker Hub (txn2/rtbeat) using DOCKERHUB_USERNAME / DOCKERHUB_TOKEN org secrets that don't exist. Rather than provision Docker Hub credentials, publish to the GitHub Container Registry.

Changes

  • release.yml — log in to ghcr.io with github.actor + the built-in GITHUB_TOKEN (no external secret; the release job already has packages: write).
  • .goreleaser.yml — image txn2/rtbeatghcr.io/txn2/rtbeat. Cosign keyless signing, multi-arch (linux/amd64,arm64), and the org.opencontainers.image.source repo link are unchanged.
  • Dropped every DOCKERHUB_* reference.
  • Docs point at the new path: README.md (badge + docker run), docs/index.md, SECURITY.md, CLAUDE.md.

Why GHCR

  • No external registry secret to manage — uses GITHUB_TOKEN.
  • Free for public repos; the package links to this repo for provenance.

After merge (to actually cut a release)

  • The v1.2.0 tag predates this fix, so re-running the failed run won't help (it checks out the old tagged commit). Delete & re-push v1.2.0 (or tag v1.2.1) at the new master.
  • One-time: set the published rtbeat package to public (repo → Packages → rtbeat → Package settings) so it pulls without a secret.

Migration note

Production currently pulls txn2/rtbeat:1.1.1 from Docker Hub; new releases publish to ghcr.io/txn2/rtbeat:<version>. k8s image references move to ghcr on the next upgrade.

Doc/YAML only — no Go build impact; action SHA pins validated.

The release pushed images to Docker Hub (txn2/rtbeat), which needed
DOCKERHUB_USERNAME / DOCKERHUB_TOKEN org secrets that don't exist, so
the v1.2.0 release failed at the Docker Hub login step.

Switch to the GitHub Container Registry, which authenticates with the
built-in GITHUB_TOKEN (no external secret; the release job already has
packages: write) and is free for public repos:

- release.yml: log in to ghcr.io with github.actor + GITHUB_TOKEN.
- .goreleaser.yml: image txn2/rtbeat -> ghcr.io/txn2/rtbeat (Cosign
  signing, multi-arch, and the image.source repo link are unchanged).
- Drop all DOCKERHUB_* references.
- Docs (README badge + docker run, docs/index.md, SECURITY.md,
  CLAUDE.md) point at ghcr.io/txn2/rtbeat.

Migration: production pulls txn2/rtbeat:1.1.1 from Docker Hub today;
new releases publish to ghcr.io/txn2/rtbeat:<version>, and the package
must be set public once so it pulls without a secret.

Closes #17
@cjimti cjimti merged commit e4871c3 into master Jun 17, 2026
10 checks passed
@cjimti cjimti deleted the 17-ghcr-container-registry branch June 17, 2026 05:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Publish container images to GHCR instead of Docker Hub

1 participant