Skip to content

Commit

Permalink
build: use cross-compilation build instead of emulated build for fast…
Browse files Browse the repository at this point in the history
  • Loading branch information
joshiste committed Oct 20, 2023
1 parent 27e6916 commit 4dd0ac4
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,23 @@
##
## Build
##
FROM golang:1.20-alpine AS build
FROM --platform=$BUILDPLATFORM golang:1.20-alpine AS build

ARG TARGETOS TARGETARCH
ARG NAME
ARG VERSION
ARG REVISION

WORKDIR /app

RUN apk add build-base
COPY go.mod ./
COPY go.sum ./
RUN go mod download

COPY . .

RUN apk add build-base
RUN go build \
RUN GOOS=$TARGETOS GOARCH=$TARGETARCH go build \
-ldflags="\
-X 'github.com/steadybit/extension-kit/extbuild.ExtensionName=${NAME}' \
-X 'github.com/steadybit/extension-kit/extbuild.Version=${VERSION}' \
Expand All @@ -29,7 +30,7 @@ RUN make licenses-report
##
## Runtime
##
FROM alpine:3.16
FROM alpine:3.18

LABEL "steadybit.com.discovery-disabled"="true"

Expand Down

0 comments on commit 4dd0ac4

Please sign in to comment.