diff --git a/Dockerfile b/Dockerfile index a363693..a603001 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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}' \ @@ -29,7 +30,7 @@ RUN make licenses-report ## ## Runtime ## -FROM alpine:3.16 +FROM alpine:3.18 LABEL "steadybit.com.discovery-disabled"="true"