From: Alexander Goussas Date: Sun, 26 Apr 2026 04:31:38 +0000 (-0500) Subject: chore: enable multi-arch builds and add build script X-Git-Url: http://git.frustrated-labs.net/?a=commitdiff_plain;h=3c7a35abba5d9e197e76f0d4793a7a17bcb6619e;p=squad-rotation-bot.git chore: enable multi-arch builds and add build script --- 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"