From c94915b3607fdaedc4c0fc0f7bc8b59d4eaa44ad Mon Sep 17 00:00:00 2001 From: Akshat Singhal Date: Fri, 27 Feb 2026 11:28:42 +0530 Subject: [PATCH 1/5] Add multi-platform Docker image support (amd64 + arm64) 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 --- .github/workflows/go.yaml | 1 + Dockerfile | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/go.yaml b/.github/workflows/go.yaml index ac7802c..850e208 100644 --- a/.github/workflows/go.yaml +++ b/.github/workflows/go.yaml @@ -84,6 +84,7 @@ jobs: push: true context: . file: Dockerfile + platforms: linux/amd64,linux/arm64 provenance: true sbom: true cache-from: type=gha diff --git a/Dockerfile b/Dockerfile index af9b5cd..6b08421 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,7 +9,9 @@ RUN go mod download # Copy source code (this layer changes frequently) COPY . . -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 # Final stage - distroless FROM gcr.io/distroless/static-debian12 From 24120979ec836aeae61d9533db2e982020c91286 Mon Sep 17 00:00:00 2001 From: Akshat Singhal Date: Fri, 27 Feb 2026 11:29:13 +0530 Subject: [PATCH 2/5] Update README.md with tag v0.0.7 Co-Authored-By: Claude Opus 4.5 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c418cc2..fe46474 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ To deploy the server, you need to build a Docker image using the provided `Docke ```dockerfile # Use the official static-server image as the base image # This will pull the prebuilt version of the static-server to run your static website -FROM zopdev/static-server:v0.0.6 +FROM zopdev/static-server:v0.0.7 # Copy static files into the container # The 'COPY' directive moves your static files (in this case, located at '/app/out') into the '/website' directory From aa0c39232c03491e1041396f02d6f9a76b84b523 Mon Sep 17 00:00:00 2001 From: Akshat Singhal Date: Fri, 27 Feb 2026 11:37:58 +0530 Subject: [PATCH 3/5] Add QEMU setup for multi-platform Docker builds Required for arm64 emulation on amd64 runners. Co-Authored-By: Claude Opus 4.5 --- .github/workflows/go.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/go.yaml b/.github/workflows/go.yaml index 850e208..3d4896c 100644 --- a/.github/workflows/go.yaml +++ b/.github/workflows/go.yaml @@ -69,6 +69,8 @@ jobs: steps: - uses: actions/checkout@v4 + - uses: docker/setup-qemu-action@v3 + - uses: docker/setup-buildx-action@v3 - uses: docker/login-action@v3 From ecb09f791cace98229aeb06e2bfa9f99a729cc58 Mon Sep 17 00:00:00 2001 From: Akshat Singhal Date: Fri, 27 Feb 2026 11:50:44 +0530 Subject: [PATCH 4/5] Use cross-compilation for multi-platform Docker builds 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 --- .github/workflows/go.yaml | 2 -- Dockerfile | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/go.yaml b/.github/workflows/go.yaml index 3d4896c..850e208 100644 --- a/.github/workflows/go.yaml +++ b/.github/workflows/go.yaml @@ -69,8 +69,6 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: docker/setup-qemu-action@v3 - - uses: docker/setup-buildx-action@v3 - uses: docker/login-action@v3 diff --git a/Dockerfile b/Dockerfile index 6b08421..8f1ed72 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ -# 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 WORKDIR /src From 3449b51b4db54fa74414ba6541a8cb2414556758 Mon Sep 17 00:00:00 2001 From: Akshat Singhal Date: Fri, 27 Feb 2026 12:04:59 +0530 Subject: [PATCH 5/5] Update GitHub Actions to latest versions and add image output MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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 --- .github/workflows/go.yaml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/go.yaml b/.github/workflows/go.yaml index 850e208..6316773 100644 --- a/.github/workflows/go.yaml +++ b/.github/workflows/go.yaml @@ -12,11 +12,10 @@ jobs: runs-on: ubuntu-latest name: Test and Build steps: - - uses: actions/checkout@v4 - - uses: actions/setup-go@v4 + - uses: actions/checkout@v6 + - uses: actions/setup-go@v6 with: go-version: '1.26' - cache: true - name: Test run: go test ./... @@ -24,12 +23,11 @@ jobs: name: Code Quality🎖️ runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: actions/setup-go@v4 + - 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 with: version: v2.10.1 args: --timeout 9m0s @@ -67,7 +65,7 @@ jobs: contents: read packages: write steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - uses: docker/setup-buildx-action@v3 @@ -91,3 +89,6 @@ jobs: cache-to: type=gha,mode=max tags: | ${{ vars.DOCKER_REGISTRY_TARGET }}:${{ env.RELEASE_VERSION }} + + - name: Output Image Path + run: echo "Image pushed to ${{ vars.DOCKER_REGISTRY_TARGET }}:${{ env.RELEASE_VERSION }}"