mirror of
https://gitlab.com/ric_harvey/MailHog.git
synced 2024-11-23 14:24:03 +00:00
6fcf01a4b0
As of 1.18, `go get <package>` no longer builds executables. `go install` should be used to install an executable instead. See the deprecation message for more information: https://go.dev/doc/go-get-install-deprecation Pinning to a specific go Docker image will help keep things from breaking unexpectedly in the future
29 lines
634 B
Docker
29 lines
634 B
Docker
#
|
|
# MailHog Dockerfile
|
|
#
|
|
|
|
FROM golang:1.18-alpine as builder
|
|
|
|
# Install MailHog:
|
|
RUN apk --no-cache add --virtual build-dependencies \
|
|
git \
|
|
&& mkdir -p /root/gocode \
|
|
&& export GOPATH=/root/gocode \
|
|
&& go install github.com/mailhog/MailHog@latest
|
|
|
|
FROM alpine:3
|
|
# Add mailhog user/group with uid/gid 1000.
|
|
# This is a workaround for boot2docker issue #581, see
|
|
# https://github.com/boot2docker/boot2docker/issues/581
|
|
RUN adduser -D -u 1000 mailhog
|
|
|
|
COPY --from=builder /root/gocode/bin/MailHog /usr/local/bin/
|
|
|
|
USER mailhog
|
|
|
|
WORKDIR /home/mailhog
|
|
|
|
ENTRYPOINT ["MailHog"]
|
|
|
|
# Expose the SMTP and HTTP ports:
|
|
EXPOSE 1025 8025
|