github.com/Blockdaemon/celo-blockchain@v0.0.0-20200129231733-e667f6b08419/Dockerfile (about) 1 # How to test changes to this file 2 # docker build -f Dockerfile -t gcr.io/celo-testnet/geth:$USER . 3 # To locally run that image 4 # docker rm geth_container ; docker run --name geth_container gcr.io/celo-testnet/geth:$USER 5 # and connect to it with 6 # docker exec -t -i geth_container /bin/sh 7 # 8 # Once you are satisfied, build the image using 9 # export COMMIT_SHA=$(git rev-parse HEAD) 10 # docker build -f Dockerfile --build-arg COMMIT_SHA=$COMMIT_SHA -t gcr.io/celo-testnet/geth:$COMMIT_SHA . 11 # 12 # push the image to the cloud 13 # docker push gcr.io/celo-testnet/geth:$COMMIT_SHA 14 # 15 # To use this image for testing, modify GETH_NODE_DOCKER_IMAGE_TAG in celo-monorepo/.env file 16 17 FROM ubuntu:16.04 as rustbuilder 18 RUN apt update && apt install -y curl musl-tools 19 RUN curl https://sh.rustup.rs -sSf | sh -s -- -y 20 ENV PATH=$PATH:~/.cargo/bin 21 RUN $HOME/.cargo/bin/rustup install 1.37.0 && $HOME/.cargo/bin/rustup default 1.37.0 && $HOME/.cargo/bin/rustup target add x86_64-unknown-linux-musl 22 ADD ./vendor /go-ethereum/vendor 23 RUN cd /go-ethereum/vendor/github.com/celo-org/bls-zexe/bls && $HOME/.cargo/bin/cargo build --target x86_64-unknown-linux-musl --release 24 25 # Build Geth in a stock Go builder container 26 FROM golang:1.11-alpine as builder 27 28 RUN apk add --no-cache make gcc musl-dev linux-headers 29 ADD . /go-ethereum 30 RUN mkdir -p /go-ethereum/vendor/github.com/celo-org/bls-zexe/bls/target/release 31 COPY --from=rustbuilder /go-ethereum/vendor/github.com/celo-org/bls-zexe/bls/target/x86_64-unknown-linux-musl/release/libbls_zexe.a /go-ethereum/vendor/github.com/celo-org/bls-zexe/bls/target/release 32 COPY --from=rustbuilder /go-ethereum/vendor/github.com/celo-org/bls-zexe/bls/target/x86_64-unknown-linux-musl/release/libbls_snark.a /go-ethereum/vendor/github.com/celo-org/bls-zexe/bls/target/release 33 RUN cd /go-ethereum && make geth 34 35 # Pull Geth into a second stage deploy alpine container 36 FROM alpine:latest 37 ARG COMMIT_SHA 38 39 RUN apk add --no-cache ca-certificates 40 COPY --from=builder /go-ethereum/build/bin/geth /usr/local/bin/ 41 RUN echo $COMMIT_SHA > /version.txt 42 ADD scripts/run_geth_in_docker.sh / 43 44 EXPOSE 8545 8546 30303 30303/udp 45 ENTRYPOINT ["sh", "/run_geth_in_docker.sh"]