From 726c253eeaf7cdfa7b2aecc11402db46b08e898a Mon Sep 17 00:00:00 2001 From: Pavel Kiselyov Date: Fri, 11 May 2018 10:03:15 +0300 Subject: [PATCH] docker: optimize build process for extended file --- Dockerfile.extended | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/Dockerfile.extended b/Dockerfile.extended index 04351bb9aa..d93ff0c969 100644 --- a/Dockerfile.extended +++ b/Dockerfile.extended @@ -3,23 +3,17 @@ FROM golang:1.10-alpine as builder RUN apk add --no-cache make gcc musl-dev linux-headers -ADD . /go-ethereum -RUN cd /go-ethereum && make all - -# Pull all binaries into a second stage deploy alpine container -FROM alpine:latest - -RUN apk add --no-cache ca-certificates -COPY --from=builder /go-ethereum/build/bin/geth /usr/local/bin/ - -# Pull golang directory and set related environment variables -COPY --from=builder /usr/local/go /usr/local/go -ENV GOPATH /go -ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH -RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH" - # Install dependencies for `go get` RUN apk update && apk upgrade && \ apk add --no-cache bash git openssh mercurial bzr +ADD . /go-ethereum +RUN cd /go-ethereum && make all + +# Pull all binaries into a second stage deploy alpine container +FROM builder + +RUN apk add --no-cache ca-certificates +COPY --from=builder /go-ethereum/build/bin/* /usr/local/bin/ + EXPOSE 8545 8546 30303 30303/udp