From 068b03e79b50531a90b521cba3f0f9fcd0e2eec5 Mon Sep 17 00:00:00 2001 From: Roy Crihfield Date: Tue, 26 Mar 2024 20:07:34 +0800 Subject: [PATCH] dockerfile cleanup --- .../cerc-fixturenet-eth-genesis/Dockerfile | 12 +++++------- .../cerc-fixturenet-eth-lighthouse/Dockerfile | 8 +++----- .../data/container-build/cerc-lighthouse/Dockerfile | 6 ++++-- 3 files changed, 12 insertions(+), 14 deletions(-) diff --git a/stack_orchestrator/data/container-build/cerc-fixturenet-eth-genesis/Dockerfile b/stack_orchestrator/data/container-build/cerc-fixturenet-eth-genesis/Dockerfile index 562ff80b..adfba588 100644 --- a/stack_orchestrator/data/container-build/cerc-fixturenet-eth-genesis/Dockerfile +++ b/stack_orchestrator/data/container-build/cerc-fixturenet-eth-genesis/Dockerfile @@ -2,24 +2,22 @@ FROM skylenet/ethereum-genesis-generator@sha256:210353ce7c898686bc5092f16c61220a FROM golang:1.20-alpine as builder -RUN apk add --no-cache python3 py3-pip - -COPY genesis /opt/genesis +RUN apk add --no-cache python3 py3-pip make bash envsubst jq # Install ethereum-genesis-generator tools -COPY --from=ethgen /usr/local/bin/eth2-testnet-genesis /usr/local/bin/ -COPY --from=ethgen /usr/local/bin/eth2-val-tools /usr/local/bin/ COPY --from=ethgen /apps /apps RUN cd /apps/el-gen && pip3 install --break-system-packages -r requirements.txt RUN pip3 install --break-system-packages --upgrade "web3==v6.15.1" RUN pip3 install --break-system-packages --upgrade "typing-extensions" +# Install tool to generate initial block +RUN go install github.com/cerc-io/eth-dump-genblock@b29516740fc01cf1d1d623acbfd0e9a2b6440a96 + # Build genesis config -RUN apk add --no-cache make bash envsubst jq +COPY genesis /opt/genesis RUN cd /opt/genesis && make genesis-el # Snag the genesis block info. -RUN go install github.com/cerc-io/eth-dump-genblock@latest RUN eth-dump-genblock /opt/genesis/build/el/geth.json > /opt/genesis/build/el/genesis_block.json FROM alpine:latest diff --git a/stack_orchestrator/data/container-build/cerc-fixturenet-eth-lighthouse/Dockerfile b/stack_orchestrator/data/container-build/cerc-fixturenet-eth-lighthouse/Dockerfile index eb791c68..b96046fa 100644 --- a/stack_orchestrator/data/container-build/cerc-fixturenet-eth-lighthouse/Dockerfile +++ b/stack_orchestrator/data/container-build/cerc-fixturenet-eth-lighthouse/Dockerfile @@ -12,16 +12,14 @@ RUN apt-get update && apt-get -y upgrade && apt-get install -y --no-install-reco && apt-get clean \ && rm -rf /var/lib/apt/lists/* -COPY genesis /opt/testnet -COPY run-cl.sh /opt/testnet/run.sh - COPY --from=lcli /usr/local/bin/lcli /usr/local/bin/lcli -COPY --from=ethgen /usr/local/bin/eth2-testnet-genesis /usr/local/bin/eth2-testnet-genesis -COPY --from=ethgen /usr/local/bin/eth2-val-tools /usr/local/bin/eth2-val-tools COPY --from=ethgen /apps /apps COPY --from=fnetgen /opt/genesis/el /opt/testnet/el COPY --from=fnetgen /opt/genesis/build/el /opt/testnet/build/el +COPY genesis /opt/testnet +COPY run-cl.sh /opt/testnet/run.sh + RUN cd /opt/testnet && make genesis-cl # Work around some bugs in lcli where the default path is always used. diff --git a/stack_orchestrator/data/container-build/cerc-lighthouse/Dockerfile b/stack_orchestrator/data/container-build/cerc-lighthouse/Dockerfile index 08a751f8..de321500 100644 --- a/stack_orchestrator/data/container-build/cerc-lighthouse/Dockerfile +++ b/stack_orchestrator/data/container-build/cerc-lighthouse/Dockerfile @@ -1,8 +1,10 @@ FROM sigp/lighthouse:v5.1.2 -RUN apt-get update; apt-get install bash netcat curl less jq wget -y; +RUN apt-get update && apt-get -y upgrade \ + && apt-get -y install bash netcat curl less jq wget \ + && apt-get clean && rm -rf /var/lib/apt/lists/* -WORKDIR /root/ +WORKDIR /root ADD start-lighthouse.sh . ENTRYPOINT [ "./start-lighthouse.sh" ]