2019-09-10 16:18:39 +00:00
|
|
|
FROM statusteam/nim-base AS build
|
|
|
|
|
2019-11-07 01:32:10 +00:00
|
|
|
RUN apt-get -qq update \
|
|
|
|
&& apt-get -qq -y install build-essential make wget 2>/dev/null >/dev/null
|
2019-09-10 16:18:39 +00:00
|
|
|
|
|
|
|
RUN export GO_TAR_GZ=go1.12.6.linux-amd64.tar.gz \
|
|
|
|
&& cd /tmp/ \
|
2019-11-07 01:32:10 +00:00
|
|
|
&& wget --progress=dot:giga https://dl.google.com/go/$GO_TAR_GZ \
|
|
|
|
&& tar -xf $GO_TAR_GZ \
|
2019-09-10 16:18:39 +00:00
|
|
|
&& mv go /usr/local \
|
|
|
|
&& rm $GO_TAR_GZ
|
|
|
|
|
|
|
|
ARG GIT_REVISION
|
|
|
|
|
|
|
|
RUN export GOROOT=/usr/local/go \
|
|
|
|
&& export PATH=$GOROOT/bin:$PATH \
|
2019-09-10 22:13:27 +00:00
|
|
|
&& git clone https://github.com/status-im/nim-beacon-chain.git \
|
|
|
|
&& cd nim-beacon-chain \
|
2019-09-10 16:18:39 +00:00
|
|
|
&& git reset --hard ${GIT_REVISION} \
|
2019-11-07 01:32:10 +00:00
|
|
|
&& { make 2>/dev/null >/dev/null || true; } \
|
|
|
|
&& make -j8 update \
|
|
|
|
&& make deps \
|
2019-09-10 16:18:39 +00:00
|
|
|
&& cp vendor/go/bin/p2pd /usr/bin/p2pd \
|
2019-09-10 22:13:27 +00:00
|
|
|
&& cp docker/run_in_docker.sh /usr/bin/run_beacon_node.sh
|
2019-09-10 16:18:39 +00:00
|
|
|
|
|
|
|
ARG NETWORK
|
2019-11-13 01:27:46 +00:00
|
|
|
ARG NETWORK_NIM_FLAGS
|
2019-09-10 16:18:39 +00:00
|
|
|
|
2019-09-10 22:13:27 +00:00
|
|
|
RUN cd nim-beacon-chain \
|
2019-09-10 16:18:39 +00:00
|
|
|
&& ./env.sh nim \
|
|
|
|
-o:/usr/bin/beacon_node \
|
|
|
|
-d:release \
|
2019-10-29 00:37:36 +00:00
|
|
|
-d:insecure \
|
2019-09-10 16:18:39 +00:00
|
|
|
--debugger:native \
|
|
|
|
--debugInfo \
|
2019-11-07 01:32:10 +00:00
|
|
|
--verbosity:0 \
|
|
|
|
--hints:off \
|
|
|
|
--warnings:off \
|
2019-11-13 01:27:46 +00:00
|
|
|
${NETWORK_NIM_FLAGS} \
|
2019-09-10 22:13:27 +00:00
|
|
|
-d:"chronicles_log_level=DEBUG" \
|
2019-11-11 23:28:06 +00:00
|
|
|
-d:"testnet_servers_image" \
|
2019-09-10 22:13:27 +00:00
|
|
|
c beacon_chain/beacon_node.nim
|
2019-09-10 16:18:39 +00:00
|
|
|
|
|
|
|
# --------------------------------- #
|
|
|
|
# Starting new image to reduce size #
|
|
|
|
# --------------------------------- #
|
|
|
|
FROM debian:9-slim
|
|
|
|
|
2019-11-07 01:32:10 +00:00
|
|
|
RUN apt-get -qq update \
|
|
|
|
&& apt-get -qq -y install librocksdb-dev psmisc 2>/dev/null >/dev/null \
|
|
|
|
&& apt-get -qq clean \
|
2019-09-10 16:18:39 +00:00
|
|
|
&& 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/run_beacon_node.sh /usr/bin/run_beacon_node.sh
|
|
|
|
COPY --from=build /usr/bin/p2pd /usr/bin/p2pd
|
|
|
|
|
|
|
|
MAINTAINER Zahary Karadjov <zahary@status.im>
|
|
|
|
LABEL description="Nimbus installation that can act as an ETH2 network bootstrap node."
|
|
|
|
|
2019-11-07 01:32:10 +00:00
|
|
|
ARG GIT_REVISION
|
2019-09-10 22:13:27 +00:00
|
|
|
RUN echo Built from Git revision: ${GIT_REVISION}
|
|
|
|
|
2019-09-26 16:07:38 +00:00
|
|
|
# TODO: This custom entry script is necessary only because we must clean up
|
|
|
|
# temporary files left by previous executions of the Go daeamon.
|
|
|
|
# We should be able to remove it once we have a native LibP2P impl.
|
|
|
|
ENTRYPOINT ["/usr/bin/run_beacon_node.sh"]
|
2019-11-07 01:32:10 +00:00
|
|
|
|