FROM debian:bullseye-slim AS build SHELL ["/bin/bash", "-c"] RUN apt-get -qq update \ && apt-get -qq -y install build-essential make wget librocksdb-dev libpcre3-dev golang-go git &>/dev/null \ && apt-get -qq clean # let Docker cache this between Git revision and testnet version changes RUN cd /root \ && git clone https://github.com/status-im/nim-beacon-chain.git \ && cd nim-beacon-chain \ && { make &>/dev/null || true; } \ && make -j$(nproc) update \ && make deps ARG GIT_REVISION ARG NETWORK_NIM_FLAGS RUN cd /root/nim-beacon-chain \ && git fetch \ && git reset --hard ${GIT_REVISION} \ && make -j$(nproc) update \ && make LOG_LEVEL=DEBUG NIMFLAGS="-d:release -d:insecure -d:testnet_servers_image ${NETWORK_NIM_FLAGS}" beacon_node # --------------------------------- # # Starting new image to reduce size # # --------------------------------- # FROM debian:bullseye-slim SHELL ["/bin/bash", "-c"] RUN apt-get -qq update \ && apt-get -qq -y install librocksdb-dev libpcre3 psmisc &>/dev/null \ && apt-get -qq clean \ && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* COPY run_in_docker.sh /usr/bin/run_beacon_node.sh COPY --from=build /root/nim-beacon-chain/build/beacon_node /usr/bin/beacon_node COPY --from=build /root/nim-beacon-chain/vendor/go/bin/p2pd /usr/bin/p2pd MAINTAINER Zahary Karadjov LABEL description="Nimbus installation that can act as an ETH2 network bootstrap node." # 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"]