Conversation
akshat-kumar-singhal
commented
Feb 27, 2026
- Added support for arm64
- Updated action versions
- Added step to print the image registry path
Enable native arm64 support for Apple Silicon users by building multi-architecture images via buildx. Uses TARGETARCH for explicit Go cross-compilation. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Required for arm64 emulation on amd64 runners. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Replace QEMU emulation with native cross-compilation by adding --platform=$BUILDPLATFORM to the build stage. Go cross-compiles to the target architecture natively, eliminating slow emulation. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- actions/checkout v4 → v6 - actions/setup-go v4 → v6 (caching now enabled by default) - golangci/golangci-lint-action v8 → v9 - Add step to output pushed image registry path Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR updates the build/release pipeline to publish multi-architecture Docker images (amd64 + arm64) and refreshes related CI action versions, alongside a README image tag bump.
Changes:
- Cross-compiles the Go binary for the target architecture during Docker builds and publishes
linux/amd64+linux/arm64images via Buildx. - Updates GitHub Action versions and adds a step to print the pushed image tag.
- Updates the README example image version to
zopdev/static-server:v0.0.7.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| README.md | Bumps the documented prebuilt image tag from v0.0.6 to v0.0.7. |
| Dockerfile | Uses BuildKit platform args to cross-compile for multi-arch builds. |
| .github/workflows/go.yaml | Updates actions, builds/pushes multi-arch images, and prints the resulting image tag. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # Build stage | ||
| FROM golang:1.26 AS build | ||
| # Build stage - runs on native platform, cross-compiles to target | ||
| FROM --platform=$BUILDPLATFORM golang:1.26 AS build |
There was a problem hiding this comment.
The Docker image uses golang:1.26, but go.mod declares go 1.25.0. If 1.26 is required, consider updating go.mod (and any local/toolchain docs) to match; otherwise pin the Docker build stage to the same Go version as go.mod to avoid CI/local mismatches.
| FROM --platform=$BUILDPLATFORM golang:1.26 AS build | |
| FROM --platform=$BUILDPLATFORM golang:1.25.0 AS build |
| RUN CGO_ENABLED=0 go build -ldflags="-s -w" -o /app/main main.go | ||
|
|
||
| ARG TARGETARCH | ||
| RUN CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} go build -ldflags="-s -w" -o /app/main main.go |
There was a problem hiding this comment.
ARG TARGETARCH is required for the GOARCH=${TARGETARCH} build. If someone builds with a non-BuildKit/legacy builder where TARGETARCH isn't automatically provided, this will produce an empty GOARCH and fail the build. Consider adding a safe default (e.g., fall back to go env GOARCH) so docker build . works reliably without requiring extra flags.
| RUN CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} go build -ldflags="-s -w" -o /app/main main.go | |
| RUN export GOARCH=${TARGETARCH:-$(go env GOARCH)} \ | |
| && CGO_ENABLED=0 GOOS=linux GOARCH=$GOARCH go build -ldflags="-s -w" -o /app/main main.go |
| - uses: actions/setup-go@v6 | ||
| with: | ||
| go-version: '1.26' | ||
| cache: true | ||
| - name: Test |
There was a problem hiding this comment.
Go version in CI is pinned to 1.26 while go.mod declares go 1.25.0. To keep toolchains consistent across local builds, Docker builds, and CI, consider aligning these (either bump go.mod to 1.26 if intended, or run CI with 1.25.x).
| - uses: actions/checkout@v6 | ||
| - uses: actions/setup-go@v6 | ||
| with: | ||
| go-version: '1.26' | ||
| cache: true | ||
| - uses: golangci/golangci-lint-action@v8 | ||
| - uses: golangci/golangci-lint-action@v9 |
There was a problem hiding this comment.
actions/setup-go no longer enables module/build caching here (the previous cache: true was removed and there’s no actions/cache usage elsewhere). This will slow down PR CI runs; consider re-enabling caching (via setup-go’s cache option if still supported, or explicit actions/cache for ~/go/pkg/mod and ~/.cache/go-build).
There was a problem hiding this comment.
actions/setup-go@v6 has cache enabled by default