Skip to content

ci(release): publish multi-arch Docker image to ghcr.io on tag#3

Merged
frahlg merged 1 commit into
mainfrom
ci/docker-image-publish
May 13, 2026
Merged

ci(release): publish multi-arch Docker image to ghcr.io on tag#3
frahlg merged 1 commit into
mainfrom
ci/docker-image-publish

Conversation

@frahlg
Copy link
Copy Markdown
Member

@frahlg frahlg commented May 13, 2026

Summary

Publishes ghcr.io/srcfl/hugin-agent:vX.Y.Z (linux/amd64 + linux/arm64 manifest) alongside the existing tarballs on every release tag. Unblocks the 42W docker-compose sidecar story.

Changes

  • Dockerfile — multi-stage build, non-root hugin user, named volume for creds persistence, --no-browser CMD default
  • .goreleaser.ymldockers: block per-arch + docker_manifests: to combine into a single multi-arch tag
  • .github/workflows/release.ymlpackages: write permission + QEMU + buildx + GHCR login steps (using GITHUB_TOKEN; no extra secret needed)
  • README.md — new Docker section with a compose snippet showing the sidecar pattern

Test plan

  • YAML + workflow files parse
  • Tag a release (v0.2.1 or similar) and verify the image lands at ghcr.io/srcfl/hugin-agent
  • docker pull ghcr.io/srcfl/hugin-agent:latest works on x86 + arm64 hosts
  • docker run --rm -p 19191:19090 ghcr.io/srcfl/hugin-agent:latest --token=smoke listens + responds to curl localhost:19191/v1/health

Compatibility with PR #2 (brew tap + scoop bucket auto-publish)

Independent. Both PRs touch .github/workflows/release.yml but on different lines (this adds new steps + a new permission; #2 adds an env entry). Merge order doesn't matter; the second merger does a 1-line conflict resolution at most.

Out of scope

  • Pushing to a non-GHCR registry (Docker Hub, etc.) — easy to add later if needed
  • Signing the Docker image with cosign — separate concern, can layer in after Apple/Windows code-signing lands

🤖 Generated with Claude Code

Unblocks bundling hugin-agent as a sidecar in other Docker-native
products (forty-two-watts being the immediate consumer).

What lands:

Dockerfile (repo root)
  Multi-stage build (golang:1.25-alpine → alpine:3.21). Runs as
  non-root `hugin` user. Container-friendly defaults:
    HUGIN_AGENT_HOST=0.0.0.0      (reachable from outside the container)
    HUGIN_AGENT_PORT=19090
    HUGIN_AGENT_CREDS=/var/lib/hugin-agent/creds.json
  CMD --no-browser because there's no browser to open inside the
  container. The pairing URL is printed to stderr; the parent
  product's UI or `docker logs` surfaces it. /var/lib/hugin-agent
  is a named volume so creds.json survives container restarts.

.goreleaser.yml
  dockers: + docker_manifests: blocks for linux/amd64 + linux/arm64.
  arm64 explicitly for Raspberry Pi installs (a big 42W use case).
  Three tag aliases per release: vX.Y.Z, vX.Y, latest.

.github/workflows/release.yml
  Adds packages: write permission and three pre-goreleaser steps:
  QEMU setup, buildx setup, GHCR login (using GITHUB_TOKEN — no
  extra secret needed for same-org GHCR publish).

README.md
  New Docker section between Scoop and "From source", with a
  docker-compose snippet showing the sidecar pattern.

The brew tap + scoop bucket auto-publish PR (#2) is independent;
both can land in either order. Same release tag drives all three
publishers (tarballs, image, brew/scoop) when both PRs are merged.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@frahlg frahlg merged commit 48ac0b5 into main May 13, 2026
@frahlg frahlg deleted the ci/docker-image-publish branch May 13, 2026 06:05
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d64c7e63e1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Dockerfile
Comment on lines +22 to +26
COPY go.mod go.sum ./
RUN go mod download

COPY . .
RUN CGO_ENABLED=0 go build \
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Avoid rebuilding from source in GoReleaser Docker stage

This Dockerfile assumes the repository source is present (COPY go.mod go.sum ./ and COPY . .), but GoReleaser’s Docker pipeline builds from a temporary artifact context rather than the repo root, so release-tag runs will fail with COPY failed: file not found in build context before any image can be pushed. In other words, this change breaks the new GHCR publish path in .github/workflows/release.yml; the Dockerfile used by GoReleaser needs to copy prebuilt artifacts from the context instead of running go build from source.

Useful? React with 👍 / 👎.

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.

1 participant