You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
410 B
Docker
23 lines
410 B
Docker
2 years ago
|
# 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" ]
|