make mop/Dockerfile use build stages (#426)

This commit is contained in:
Atul Bhosale 2018-09-15 00:38:11 +05:30 committed by Jess Frazelle
parent 2d259b95ed
commit 8d1c962183

View File

@ -5,7 +5,7 @@
# --name mop \
# r.j3ss.co/mop
#
FROM alpine:latest
FROM alpine:latest as builder
RUN apk --no-cache add \
ca-certificates
@ -24,9 +24,8 @@ RUN buildDeps=' \
set -x \
&& apk --no-cache add $buildDeps \
&& go get github.com/mop-tracker/mop/cmd/mop \
&& mv /go/bin/mop /usr/bin/mop \
&& apk del $buildDeps \
&& rm -rf /go \
&& echo "Build complete."
FROM alpine:latest
COPY --from=builder /go/bin/mop /usr/bin/mop
ENTRYPOINT [ "mop" ]