Skip to content

Commit f24b321

Browse files
FIX (dockerfile): Split goose installations to different arches
1 parent 332971a commit f24b321

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Dockerfile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,15 @@ FROM --platform=$BUILDPLATFORM golang:1.23.3 AS backend-build
2828
ARG TARGETOS
2929
ARG TARGETARCH
3030

31-
# Install Go public tools needed in runtime. Use `go install` for goose so the
31+
# Install Go public tools needed in runtime. Use `go build` for goose so the
3232
# binary is compiled for the target architecture instead of downloading a
3333
# prebuilt binary which may have the wrong architecture (causes exec format
3434
# errors on ARM).
35-
RUN GOBIN=/usr/local/bin GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH:-amd64} go install github.com/pressly/goose/v3/cmd/[email protected]
35+
RUN git clone --depth 1 --branch v3.24.3 https://github.com/pressly/goose.git /tmp/goose && \
36+
cd /tmp/goose/cmd/goose && \
37+
GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH:-amd64} \
38+
go build -o /usr/local/bin/goose . && \
39+
rm -rf /tmp/goose
3640
RUN go install github.com/swaggo/swag/cmd/[email protected]
3741

3842
# Set working directory

0 commit comments

Comments
 (0)