optimize docker image size

This commit is contained in:
Nick Tan 2016-02-07 18:39:22 -08:00
parent 91a9d8afe1
commit 805a187025

14
Rockerfile Normal file
View file

@ -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" }}