-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Latest versions of mailhog and mongodb incompatible (docker-compose) #427
Comments
I went back to Mongo 4.20 to make it work. |
See mailhog/storage#12 |
Thanks to comment #1697868253 I was able to build a new version with a working storage and also I had to fix sort order for mongodb to descending, that's why I'm using my own fork for storage. Urls like mongodb://127.0.0.1:27017 now working! Here is a dockerfile, maybe it will help someone #
# MailHog Dockerfile
#
FROM golang:alpine as builder
ARG VERSION=master
ARG STORAGE_VERSION="v1.1.1"
# Install MailHog:
RUN apk --no-cache add --virtual build-dependencies gcc musl-dev make git
RUN mkdir -p /root/gocode && export GOPATH=/root/gocode && go install github.com/mitchellh/gox@latest
RUN git clone --branch ${VERSION} https://github.com/mailhog/MailHog
RUN cd MailHog \
&& go mod init \
&& go mod tidy \
&& go mod vendor \
&& go mod edit -replace github.com/mailhog/storage=github.com/p1ratrulezzz/mailhog-storage@${STORAGE_VERSION} \
&& go mod tidy \
&& go mod vendor
RUN export GOPATH=/root/gocode && export PATH=$PATH:$GOPATH/bin && cd MailHog && gox -osarch="linux/amd64" -ldflags "-X main.version=${VERSION}" -output="build/{{.Dir}}_{{.OS}}_{{.Arch}}"
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 /go/MailHog/build/MailHog_linux_amd64 /usr/local/bin/MailHog
USER mailhog
WORKDIR /home/mailhog
ENTRYPOINT ["MailHog"]
# Expose the SMTP and HTTP ports:
EXPOSE 1025 8025
|
Replicate using this docker-compose.yml:
The text was updated successfully, but these errors were encountered: