Skip to content

Commit

Permalink
optimize docker image size
Browse files Browse the repository at this point in the history
  • Loading branch information
ntan-ebates committed Feb 8, 2016
1 parent 91a9d8a commit 805a187
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Rockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# build image
FROM golang:latest
RUN go get -v github.com/mailhog/MailHog && \
cd /go/src && \
CGO_ENABLED=0 go build -a -installsuffix cgo -v -o /go/bin/MailHog.o github.com/mailhog/MailHog/main.go
EXPORT /go/bin/ /target

# run image
FROM alpine:latest
IMPORT /target/ /tmp
RUN cp /tmp/MailHog.o /MailHog
EXPOSE 1025 8025
CMD ["/MailHog"]
TAG mailhog/mailhog:{{ or .VERSION "latest" }}

0 comments on commit 805a187

Please sign in to comment.