# syntax=docker/dockerfile:1 FROM --platform=$BUILDPLATFORM golang:1.18-alpine as builder WORKDIR /app COPY ../ . RUN go mod download ARG TARGETOS TARGETARCH TARGETVARIANT RUN if [[ $TARGETVARIANT == "v7" ]]; \ then \ export GOARM=7; \ fi; \ CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH go build -o /reactor ./cmd/reactor/main.go FROM alpine COPY --from=builder /reactor . ENTRYPOINT [ "./reactor" ]