2
0
forked from drew/smtprelay

6 Commits

Author SHA1 Message Date
45a3870f8c update golang to v1.25.5 2025-12-07 08:02:26 -07:00
02b9072bd2 merge upstream 2025-12-07 14:54:52 +00:00
796b54a565 disable CGO in GO build
- We want a statically linked standalone binary.
2025-11-26 14:41:59 -07:00
bc4a31817e add explicit binary locations
- Container image seemed to be build without the binary in the right place to run.
2025-11-26 14:34:43 -07:00
55f941c7a1 disable VCS info in go build
- buildkit in the CI pipeline isn't liking it, don't really need it.
2025-11-26 14:06:17 -07:00
b30d51e9a3 add Dockerfile for smtprelay 2025-11-26 13:58:50 -07:00

23
Dockerfile Normal file
View File

@@ -0,0 +1,23 @@
# Package versions
ARG GOLANG_VERSION="1.25.5"
# 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"]