Skip to content

Commit

Permalink
Update docker file for faster multiplatform builds
Browse files Browse the repository at this point in the history
  • Loading branch information
csutorasa committed Jul 17, 2024
1 parent 31a9306 commit 9e73cf0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
FROM golang:1.22 as builder
FROM --platform=$BUILDPLATFORM golang:1.22 AS builder

COPY . /app
WORKDIR /app/
RUN export CGO_ENABLED=0 && go build -ldflags "-s -w"
RUN echo $TARGETPLATFORM
RUN export CGO_ENABLED=0 && export GOARCH=$(echo "$TARGETPLATFORM" | cut -d "/" -f2) && go build -ldflags "-s -w"

FROM alpine:latest

Expand Down

0 comments on commit 9e73cf0

Please sign in to comment.