2019-11-17 00:06:09 +00:00
|
|
|
FROM debian:bullseye-slim AS build
|
2019-09-10 16:18:39 +00:00
|
|
|
|
2019-11-17 00:06:09 +00:00
|
|
|
SHELL ["/bin/bash", "-c"]
|
2019-09-10 16:18:39 +00:00
|
|
|
|
2019-11-17 00:06:09 +00:00
|
|
|
RUN apt-get -qq update \
|
2020-02-20 21:06:40 +00:00
|
|
|
&& apt-get -qq -y install build-essential make wget libpcre3-dev golang-go git &>/dev/null \
|
2020-02-13 18:17:58 +00:00
|
|
|
&& apt-get -qq clean \
|
|
|
|
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
2019-09-10 16:18:39 +00:00
|
|
|
|
2019-11-17 00:06:09 +00:00
|
|
|
# let Docker cache this between Git revision and testnet version changes
|
|
|
|
RUN cd /root \
|
2019-09-10 22:13:27 +00:00
|
|
|
&& git clone https://github.com/status-im/nim-beacon-chain.git \
|
|
|
|
&& cd nim-beacon-chain \
|
2019-11-17 00:06:09 +00:00
|
|
|
&& { make &>/dev/null || true; } \
|
|
|
|
&& make -j$(nproc) update \
|
|
|
|
&& make deps
|
2019-09-10 16:18:39 +00:00
|
|
|
|
2020-03-22 23:34:20 +00:00
|
|
|
# Please note that the commands above have the goal of caching the
|
|
|
|
# compilation of Nim, but don't depend on the current git revision.
|
|
|
|
# This means that the cache can become outdated over time and you'll
|
|
|
|
# start seeing Nim being compiled on every run. If this happens, just
|
|
|
|
# prune your docker cache to get a fresh up-to-date version of Nim.
|
2019-11-17 00:06:09 +00:00
|
|
|
ARG GIT_REVISION
|
2019-11-13 01:27:46 +00:00
|
|
|
ARG NETWORK_NIM_FLAGS
|
2020-02-09 02:22:42 +00:00
|
|
|
ARG MARCH_NIM_FLAGS
|
2019-09-10 16:18:39 +00:00
|
|
|
|
2019-11-17 00:06:09 +00:00
|
|
|
RUN cd /root/nim-beacon-chain \
|
|
|
|
&& git fetch \
|
|
|
|
&& git reset --hard ${GIT_REVISION} \
|
|
|
|
&& make -j$(nproc) update \
|
2020-02-13 12:19:12 +00:00
|
|
|
&& make LOG_LEVEL=TRACE NIMFLAGS="-d:insecure -d:testnet_servers_image ${NETWORK_NIM_FLAGS} ${MARCH_NIM_FLAGS}" beacon_node
|
2019-09-10 16:18:39 +00:00
|
|
|
|
|
|
|
# --------------------------------- #
|
|
|
|
# Starting new image to reduce size #
|
|
|
|
# --------------------------------- #
|
2019-11-17 00:06:09 +00:00
|
|
|
FROM debian:bullseye-slim
|
|
|
|
|
|
|
|
SHELL ["/bin/bash", "-c"]
|
2019-09-10 16:18:39 +00:00
|
|
|
|
2019-11-07 01:32:10 +00:00
|
|
|
RUN apt-get -qq update \
|
2020-01-15 15:06:50 +00:00
|
|
|
&& apt-get -qq -y install libpcre3 psmisc &>/dev/null \
|
2019-11-07 01:32:10 +00:00
|
|
|
&& apt-get -qq clean \
|
2019-09-10 16:18:39 +00:00
|
|
|
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
|
|
|
|
2020-02-13 18:17:58 +00:00
|
|
|
# "COPY" creates new image layers, so we cram all we can into one command
|
2020-03-22 23:34:20 +00:00
|
|
|
COPY --from=build /root/nim-beacon-chain/docker/run_in_docker.sh /root/nim-beacon-chain/build/beacon_node /usr/bin/
|
2019-09-10 16:18:39 +00:00
|
|
|
|
|
|
|
MAINTAINER Zahary Karadjov <zahary@status.im>
|
|
|
|
LABEL description="Nimbus installation that can act as an ETH2 network bootstrap node."
|
|
|
|
|
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.
|
2020-02-13 18:17:58 +00:00
|
|
|
ENTRYPOINT ["/usr/bin/run_in_docker.sh"]
|
2019-11-07 01:32:10 +00:00
|
|
|
|