forked from drew/smtprelay
24 lines
578 B
Docker
24 lines
578 B
Docker
# Package versions
|
|
ARG GOLANG_VERSION="1.25.4"
|
|
|
|
# Stage 1: Build
|
|
FROM core.harbor.brds.ca/library/golang:${GOLANG_VERSION} AS builder
|
|
WORKDIR /project
|
|
COPY go.mod go.sum ./
|
|
RUN go mod download
|
|
|
|
COPY . .
|
|
RUN CGO_ENABLED=0 go build -buildvcs=false -o /smtprelay
|
|
|
|
# Stage 2: Package
|
|
FROM scratch
|
|
LABEL org.opencontainers.image.title="smtprelay"
|
|
LABEL org.opencontainers.image.authors="drew@brds.ca"
|
|
LABEL org.opencontainers.image.description="Image containing the smtprelay program."
|
|
|
|
WORKDIR /
|
|
COPY --from=builder /smtprelay /smtprelay
|
|
|
|
# Command to run
|
|
ENTRYPOINT ["/smtprelay"]
|