Skip to content

Commit

Permalink
build: added armv7 variant
Browse files Browse the repository at this point in the history
  • Loading branch information
Tbaile committed Jan 11, 2024
1 parent ba038e2 commit b9247f9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions core/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
FROM --platform=$BUILDPLATFORM golang:1.21.5 as base
ARG TARGETOS
ARG TARGETARCH
ARG TARGETVARIANT
ENV GOOS=${TARGETOS}
ENV GOARCH=${TARGETARCH}
WORKDIR /app
Expand Down
5 changes: 5 additions & 0 deletions core/api-server/api-server-multi-arch-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ if [ "$GOARCH" = "arm64" ]; then
apt-get update
apt-get install -y gcc-aarch64-linux-gnu
export CC=aarch64-linux-gnu-gcc
elif [ "$GOARCH" = "arm" ] && [ "$TARGETVARIANT" = "v7" ]; then
export GOARM=7
apt-get update
apt-get install -y gcc-arm-linux-gnueabihf
export CC=arm-linux-gnueabihf-gcc
fi

CGO_ENABLED=1 go build -v -ldflags='-extldflags=-static' -tags sqlite_omit_load_extension api-server.go
3 changes: 2 additions & 1 deletion docker-bake.hcl
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
target "base" {
platforms = [
"linux/arm64",
"linux/amd64"
"linux/amd64",
"linux/arm/v7"
]
cache-from = [
"type=gha"
Expand Down

0 comments on commit b9247f9

Please sign in to comment.