-
Notifications
You must be signed in to change notification settings - Fork 0
ci(release): publish multi-arch Docker image to ghcr.io on tag #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| # syntax=docker/dockerfile:1.6 | ||
| # | ||
| # Dockerfile for hugin-agent — the local helper the workbench talks | ||
| # to. Published as ghcr.io/srcfl/hugin-agent:vX.Y.Z on every release | ||
| # tag via goreleaser (see .goreleaser.yml). | ||
| # | ||
| # Primary use case: bundling inside another product's docker-compose | ||
| # stack (e.g. forty-two-watts) as a sidecar. Single static Go binary, | ||
| # ~12 MB final image, no daemon, no telemetry. | ||
| # | ||
| # Browser auto-open is disabled by default in the container — there | ||
| # is no browser; the user opens the pairing URL on their host | ||
| # manually (or via the parent product's UI). | ||
|
|
||
| # ---- Build stage ----------------------------------------------------------- | ||
| FROM golang:1.25-alpine AS builder | ||
|
|
||
| WORKDIR /src | ||
|
|
||
| RUN apk add --no-cache git | ||
|
|
||
| COPY go.mod go.sum ./ | ||
| RUN go mod download | ||
|
|
||
| COPY . . | ||
| RUN CGO_ENABLED=0 go build \ | ||
| -ldflags "-s -w -X main.version=$(git describe --tags --always --dirty 2>/dev/null || echo docker)" \ | ||
| -o /out/hugin-agent ./cmd/hugin-agent/ | ||
|
|
||
| # ---- Runtime stage --------------------------------------------------------- | ||
| FROM alpine:3.21 | ||
|
|
||
| RUN apk add --no-cache ca-certificates tzdata \ | ||
| && addgroup -S hugin \ | ||
| && adduser -S -G hugin -h /home/hugin hugin | ||
|
|
||
| COPY --from=builder /out/hugin-agent /usr/local/bin/hugin-agent | ||
|
|
||
| # Container-friendly defaults: | ||
| # - HUGIN_AGENT_HOST=0.0.0.0 so the agent is reachable from outside | ||
| # the container (the parent compose stack does port mapping or | ||
| # network_mode: host). The pairing token is still the auth boundary. | ||
| # - --no-browser passed via CMD because there's no browser to open. | ||
| # - Creds persist under /var/lib/hugin-agent so docker-compose | ||
| # volumes can keep them across container restarts. | ||
| ENV HUGIN_AGENT_HOST=0.0.0.0 \ | ||
| HUGIN_AGENT_PORT=19090 \ | ||
| HUGIN_AGENT_CREDS=/var/lib/hugin-agent/creds.json | ||
|
|
||
| RUN mkdir -p /var/lib/hugin-agent && chown hugin:hugin /var/lib/hugin-agent | ||
|
|
||
| USER hugin | ||
| WORKDIR /home/hugin | ||
| VOLUME ["/var/lib/hugin-agent"] | ||
|
|
||
| EXPOSE 19090 | ||
|
|
||
| HEALTHCHECK --interval=30s --timeout=5s --start-period=5s --retries=3 \ | ||
| CMD wget -qO- "http://127.0.0.1:${HUGIN_AGENT_PORT}/v1/health" \ | ||
| | grep -q '"status":"ok"' || exit 1 | ||
| # /v1/health is intentionally unauthenticated (see internal/server/server.go) — | ||
| # the agent's pairing-token gate sits on the work endpoints (scan, probe, | ||
| # run-lua), not on liveness probes. | ||
|
|
||
| ENTRYPOINT ["hugin-agent"] | ||
| CMD ["--no-browser"] | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This Dockerfile assumes the repository source is present (
COPY go.mod go.sum ./andCOPY . .), but GoReleaser’s Docker pipeline builds from a temporary artifact context rather than the repo root, so release-tag runs will fail withCOPY failed: file not found in build contextbefore 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 runninggo buildfrom source.Useful? React with 👍 / 👎.