diodemail/Dockerfile

17 lines
460 B
Docker

FROM chimeralinux/chimera:latest as base
FROM base as builder
WORKDIR /app
RUN apk add go
COPY . .
ARG TARGETPLATFORM
RUN if [ $TARGETPLATFORM == "linux/riscv64" ]; then \
apk add clang; \
CGO_ENABLED=1 go build -ldflags="-s -w" -o diodemail -buildmode=pie ./cmd/server; \
else \
go build -ldflags="-s -w" -o diodemail -buildmode=pie ./cmd/server; \
fi
FROM base as runner
WORKDIR /app
COPY --from=builder /app/diodemail ./diodemail
CMD ["./diodemail"]