mirror of
https://github.com/status-im/nimbus-eth2.git
synced 2025-01-14 16:47:21 +00:00
Dockerfile: less verbosity, faster build [skip ci]
This commit is contained in:
parent
a1f5f3512b
commit
e8a64e4206
@ -1,14 +1,12 @@
|
|||||||
FROM statusteam/nim-base AS build
|
FROM statusteam/nim-base AS build
|
||||||
|
|
||||||
RUN apt update \
|
RUN apt-get -qq update \
|
||||||
&& apt install -y build-essential make wget \
|
&& apt-get -qq -y install build-essential make wget 2>/dev/null >/dev/null
|
||||||
&& apt clean \
|
|
||||||
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
|
||||||
|
|
||||||
RUN export GO_TAR_GZ=go1.12.6.linux-amd64.tar.gz \
|
RUN export GO_TAR_GZ=go1.12.6.linux-amd64.tar.gz \
|
||||||
&& cd /tmp/ \
|
&& cd /tmp/ \
|
||||||
&& wget https://dl.google.com/go/$GO_TAR_GZ \
|
&& wget --progress=dot:giga https://dl.google.com/go/$GO_TAR_GZ \
|
||||||
&& tar -xvf $GO_TAR_GZ \
|
&& tar -xf $GO_TAR_GZ \
|
||||||
&& mv go /usr/local \
|
&& mv go /usr/local \
|
||||||
&& rm $GO_TAR_GZ
|
&& rm $GO_TAR_GZ
|
||||||
|
|
||||||
@ -19,15 +17,9 @@ RUN export GOROOT=/usr/local/go \
|
|||||||
&& git clone https://github.com/status-im/nim-beacon-chain.git \
|
&& git clone https://github.com/status-im/nim-beacon-chain.git \
|
||||||
&& cd nim-beacon-chain \
|
&& cd nim-beacon-chain \
|
||||||
&& git reset --hard ${GIT_REVISION} \
|
&& git reset --hard ${GIT_REVISION} \
|
||||||
&& git submodule update --init --recursive
|
&& { make 2>/dev/null >/dev/null || true; } \
|
||||||
|
&& make -j8 update \
|
||||||
RUN cd nim-beacon-chain \
|
&& make deps \
|
||||||
&& make build-system-checks
|
|
||||||
|
|
||||||
# TODO: The command above exits with 1, so we cannot chain it cleanly
|
|
||||||
RUN cd nim-beacon-chain \
|
|
||||||
&& export PATH=/usr/local/go/bin:$PATH \
|
|
||||||
&& make update deps \
|
|
||||||
&& cp vendor/go/bin/p2pd /usr/bin/p2pd \
|
&& cp vendor/go/bin/p2pd /usr/bin/p2pd \
|
||||||
&& cp docker/run_in_docker.sh /usr/bin/run_beacon_node.sh
|
&& cp docker/run_in_docker.sh /usr/bin/run_beacon_node.sh
|
||||||
|
|
||||||
@ -43,6 +35,9 @@ RUN cd nim-beacon-chain \
|
|||||||
-d:insecure \
|
-d:insecure \
|
||||||
--debugger:native \
|
--debugger:native \
|
||||||
--debugInfo \
|
--debugInfo \
|
||||||
|
--verbosity:0 \
|
||||||
|
--hints:off \
|
||||||
|
--warnings:off \
|
||||||
-d:"network_type=${NETWORK_TYPE}" \
|
-d:"network_type=${NETWORK_TYPE}" \
|
||||||
-d:"SHARD_COUNT=${SHARD_COUNT}" \
|
-d:"SHARD_COUNT=${SHARD_COUNT}" \
|
||||||
-d:"SLOTS_PER_EPOCH=${SLOTS_PER_EPOCH}" \
|
-d:"SLOTS_PER_EPOCH=${SLOTS_PER_EPOCH}" \
|
||||||
@ -56,9 +51,9 @@ RUN cd nim-beacon-chain \
|
|||||||
# --------------------------------- #
|
# --------------------------------- #
|
||||||
FROM debian:9-slim
|
FROM debian:9-slim
|
||||||
|
|
||||||
RUN apt update \
|
RUN apt-get -qq update \
|
||||||
&& apt install -y librocksdb-dev psmisc \
|
&& apt-get -qq -y install librocksdb-dev psmisc 2>/dev/null >/dev/null \
|
||||||
&& apt clean \
|
&& apt-get -qq clean \
|
||||||
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||||
|
|
||||||
COPY --from=build /usr/bin/beacon_node /usr/bin/beacon_node
|
COPY --from=build /usr/bin/beacon_node /usr/bin/beacon_node
|
||||||
@ -68,9 +63,11 @@ COPY --from=build /usr/bin/p2pd /usr/bin/p2pd
|
|||||||
MAINTAINER Zahary Karadjov <zahary@status.im>
|
MAINTAINER Zahary Karadjov <zahary@status.im>
|
||||||
LABEL description="Nimbus installation that can act as an ETH2 network bootstrap node."
|
LABEL description="Nimbus installation that can act as an ETH2 network bootstrap node."
|
||||||
|
|
||||||
|
ARG GIT_REVISION
|
||||||
RUN echo Built from Git revision: ${GIT_REVISION}
|
RUN echo Built from Git revision: ${GIT_REVISION}
|
||||||
|
|
||||||
# TODO: This custom entry script is necessary only because we must clean up
|
# TODO: This custom entry script is necessary only because we must clean up
|
||||||
# temporary files left by previous executions of the Go daeamon.
|
# temporary files left by previous executions of the Go daeamon.
|
||||||
# We should be able to remove it once we have a native LibP2P impl.
|
# We should be able to remove it once we have a native LibP2P impl.
|
||||||
ENTRYPOINT ["/usr/bin/run_beacon_node.sh"]
|
ENTRYPOINT ["/usr/bin/run_beacon_node.sh"]
|
||||||
|
|
||||||
|
@ -18,3 +18,6 @@ build:
|
|||||||
push: build
|
push: build
|
||||||
docker push $(IMAGE_NAME)
|
docker push $(IMAGE_NAME)
|
||||||
|
|
||||||
|
push-last:
|
||||||
|
docker push $(IMAGE_NAME)
|
||||||
|
|
||||||
|
@ -122,7 +122,7 @@ if [[ $PUBLISH_TESTNET_RESETS != "0" ]]; then
|
|||||||
ssh $BOOTSTRAP_HOST "sudo install -o dockremap -g docker /tmp/privkey.protobuf $BOOTSTRAP_NODE_DOCKER_PATH"
|
ssh $BOOTSTRAP_HOST "sudo install -o dockremap -g docker /tmp/privkey.protobuf $BOOTSTRAP_NODE_DOCKER_PATH"
|
||||||
|
|
||||||
echo Publishing docker image...
|
echo Publishing docker image...
|
||||||
make push
|
make push-last
|
||||||
|
|
||||||
echo Persisting testnet data to git...
|
echo Persisting testnet data to git...
|
||||||
pushd "$NETWORK_DIR_ABS"
|
pushd "$NETWORK_DIR_ABS"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user