Skip to content

Commit e4871c3

Browse files
authored
Publish container images to GHCR instead of Docker Hub (#17) (#18)
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
1 parent c3fe7d2 commit e4871c3

6 files changed

Lines changed: 12 additions & 11 deletions

File tree

‎.github/workflows/release.yml‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,12 @@ jobs:
3939
- name: Set up Docker Buildx
4040
uses: docker/setup-buildx-action@d7f5e7f509e45cec5c76c4d5afdd7de93d0b3df5 # v4.1.0
4141

42-
- name: Login to Docker Hub
42+
- name: Login to GitHub Container Registry
4343
uses: docker/login-action@650006c6eb7dba73a995cc03b0b2d7f5ca915bee # v4.2.0
4444
with:
45-
username: ${{ secrets.DOCKERHUB_USERNAME }}
46-
password: ${{ secrets.DOCKERHUB_TOKEN }}
45+
registry: ghcr.io
46+
username: ${{ github.actor }}
47+
password: ${{ secrets.GITHUB_TOKEN }}
4748

4849
- name: Install Cosign
4950
uses: sigstore/cosign-installer@6f9f17788090df1f26f669e9d70d6ae9567deba6 # v4.1.2

‎.goreleaser.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ dockers_v2:
8888
ids:
8989
- rtbeat
9090
images:
91-
- txn2/rtbeat
91+
- ghcr.io/txn2/rtbeat
9292
tags:
9393
- latest
9494
- "{{ .Tag }}"

‎CLAUDE.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,5 +58,5 @@ These differ from the pre-modules alpha the project was originally written again
5858
## Release
5959

6060
Tag `v*` → GitHub Actions runs GoReleaser v2: signed (Cosign keyless) archives with SBOMs, SLSA
61-
provenance, multi-arch Docker images (`txn2/rtbeat`), and a Homebrew formula. Releases are created as
61+
provenance, multi-arch container images (`ghcr.io/txn2/rtbeat`), and a Homebrew formula. Releases are created as
6262
drafts.

‎README.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
[![codecov](https://codecov.io/gh/txn2/rtbeat/graph/badge.svg)](https://codecov.io/gh/txn2/rtbeat)
55
[![Go Report Card](https://goreportcard.com/badge/github.com/txn2/rtbeat)](https://goreportcard.com/report/github.com/txn2/rtbeat)
66
[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/txn2/rtbeat/badge)](https://securityscorecards.dev/viewer/?uri=github.com/txn2/rtbeat)
7-
[![Docker Pulls](https://img.shields.io/docker/pulls/txn2/rtbeat.svg)](https://hub.docker.com/r/txn2/rtbeat/)
7+
[![ghcr.io](https://img.shields.io/badge/ghcr.io-txn2%2Frtbeat-2496ED?logo=github)](https://github.com/txn2/rtbeat/pkgs/container/rtbeat)
88

99
# Rtbeat
1010

@@ -44,7 +44,7 @@ full set of libbeat output and processor options.
4444

4545
```bash
4646
docker run --rm -p 8081:8081 -v "$PWD/rtbeat.yml:/rtbeat.yml" \
47-
txn2/rtbeat -c /rtbeat.yml -e
47+
ghcr.io/txn2/rtbeat -c /rtbeat.yml -e
4848
```
4949

5050
## Develop

‎SECURITY.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,14 @@ use the artifact.
6868

6969
#### Container images
7070

71-
Container images published to `txn2/rtbeat` are signed with Cosign keyless
72-
signing as well:
71+
Container images published to `ghcr.io/txn2/rtbeat` are signed with Cosign
72+
keyless signing as well:
7373

7474
```bash
7575
cosign verify \
7676
--certificate-identity-regexp "https://github.com/txn2/rtbeat" \
7777
--certificate-oidc-issuer "https://token.actions.githubusercontent.com" \
78-
txn2/rtbeat:{VERSION}
78+
ghcr.io/txn2/rtbeat:{VERSION}
7979
```
8080

8181
### SLSA Provenance

‎docs/index.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ curl -s localhost:8081/in -d '{"uuid":"demo","size":1,"messages":[{"seq":"1","pa
3535

3636
```bash
3737
docker run --rm -p 8081:8081 -v "$PWD/rtbeat.yml:/rtbeat.yml" \
38-
txn2/rtbeat -c /rtbeat.yml -e
38+
ghcr.io/txn2/rtbeat -c /rtbeat.yml -e
3939
```
4040

4141
See [Configuration](configuration.md) for the output and listener settings.

0 commit comments

Comments
 (0)