2024-10-06 18:04:13 +00:00
|
|
|
FROM chimeralinux/chimera:latest as base
|
|
|
|
FROM base as builder
|
2024-10-02 19:15:07 +00:00
|
|
|
WORKDIR /app
|
2024-10-06 18:04:13 +00:00
|
|
|
RUN apk add go
|
2024-10-02 19:15:07 +00:00
|
|
|
COPY . .
|
2024-10-06 18:04:13 +00:00
|
|
|
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
|
2024-10-02 19:15:07 +00:00
|
|
|
|
2024-10-06 18:04:13 +00:00
|
|
|
FROM base as runner
|
2024-10-02 19:15:07 +00:00
|
|
|
WORKDIR /app
|
|
|
|
COPY --from=builder /app/diodemail ./diodemail
|
|
|
|
CMD ["./diodemail"]
|