Skip to content
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

Optimise the Dockerfile for Docker Hub Automated Builds. #118

Merged
merged 1 commit into from
Nov 14, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*
35 changes: 31 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,34 @@
FROM golang:1.4
#
# MailHog Dockerfile
#

RUN go get github.com/mailhog/MailHog
FROM alpine:3.4

EXPOSE 1025 8025
# Install ca-certificates, required for the "release message" feature:
RUN apk --no-cache add \
ca-certificates

# Install MailHog:
RUN apk --no-cache add --virtual build-dependencies \
go \
git \
&& mkdir -p /root/gocode \
&& export GOPATH=/root/gocode \
&& go get github.com/mailhog/MailHog \
&& mv /root/gocode/bin/MailHog /usr/local/bin \
&& rm -rf /root/gocode \
&& apk del --purge build-dependencies

# 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

USER mailhog

ENTRYPOINT ["/go/bin/MailHog"]
WORKDIR /home/mailhog

ENTRYPOINT ["MailHog"]

# Expose the SMTP and HTTP ports:
EXPOSE 1025 8025