From 3c7a35abba5d9e197e76f0d4793a7a17bcb6619e Mon Sep 17 00:00:00 2001 From: Alexander Goussas Date: Sat, 25 Apr 2026 23:31:38 -0500 Subject: [PATCH] chore: enable multi-arch builds and add build script --- Dockerfile | 8 +++++--- scripts/build.sh | 11 +++++++++++ 2 files changed, 16 insertions(+), 3 deletions(-) create mode 100755 scripts/build.sh diff --git a/Dockerfile b/Dockerfile index 140806c..ccb82c0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,7 @@ -FROM golang:1.25 +FROM --platform=$BUILDPLATFORM golang:1.25 + +ARG TARGETPLATFORM +ARG BUILDPLATFORM WORKDIR /usr/src/app @@ -6,7 +9,6 @@ COPY go.mod go.sum ./ RUN go mod download COPY . . -RUN go build -v -o /usr/local/bin/app . +RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -v -o /usr/local/bin/app . CMD ["app"] - diff --git a/scripts/build.sh b/scripts/build.sh new file mode 100755 index 0000000..6dc7543 --- /dev/null +++ b/scripts/build.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +sha=$(git rev-parse HEAD) +base="aloussase69/squad-rotation-bot" +tag="$base:$sha" +latest="$base:latest" + +docker buildx build -t "$tag" --platform linux/amd64,linux/arm64 . --push + +docker tag "$tag" "$latest" +docker push "$latest" -- 2.43.0