Skip to content

Instantly share code, notes, and snippets.

@snmishra
Last active April 30, 2023 00:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save snmishra/bba7667b4e749d118e29532acdc26cab to your computer and use it in GitHub Desktop.
Save snmishra/bba7667b4e749d118e29532acdc26cab to your computer and use it in GitHub Desktop.
FROM golang:1 as builder
# Install MailHog:
RUN apt install git \
&& mkdir -p /root/gocode \
&& export GOPATH=/root/gocode \
&& go install github.com/mailhog/MailHog@latest
FROM gcr.io/distroless/base-debian11:nonroot
COPY --from=builder /root/gocode/bin/MailHog /usr/local/bin/
USER nonroot
WORKDIR /home/nonroot
ENTRYPOINT ["MailHog"]
# Expose the SMTP and HTTP ports:
EXPOSE 1025 8025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment