Skip to content

Commit

Permalink
Use multi-stage docker build
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthäus Mayer authored and Matthäus Mayer committed Mar 2, 2018
1 parent 25514b2 commit 7065b03
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,13 @@
FROM golang:onbuild
COPY config_example.json config.json
FROM golang:1.9.4 as build
WORKDIR /go/src/github.com/thrasher-/gocryptotrader
COPY . .
RUN mv -vn config_example.json config.json \
&& go get -v -d \
&& GOARCH=386 GOOS=linux CGO_ENABLED=0 go install -v \
&& mv /go/bin/linux_386 /go/bin/gocryptotrader

FROM alpine:latest
COPY --from=build /go/bin/gocryptotrader /app/
COPY --from=build /go/src/github.com/thrasher-/gocryptotrader/config.json /app/
EXPOSE 9050
CMD ["/app/gocryptotrader"]

0 comments on commit 7065b03

Please sign in to comment.