1+ #
2+ # The Mega Dockerfile
3+ #
4+ # This dockerfile is an attempt to bundle the following components into
5+ # one big dockerfile:
6+ #
7+ # - [x] Goevmlab binary 'generic-fuzzer'
8+ # - [x] Go-ethereum binary 'evm'
9+ # - [x] Erigon binary 'evm'
10+ # - [x] EvmOne vm binary 'evmone'
11+ # - [x] Reth VM binary 'revme'
12+ # - [x] Besu
13+ # - [x] Nethermind
14+ # - [x] Nimbus-eth1
15+ #
16+
17+ # ---------------------------------------------------------------
18+ # golang-builder (debian-based)
19+ # ---------------------------------------------------------------
20+ FROM golang:latest as golang-builder
21+
22+ #
23+ # Go-evmlab
24+ #
25+
26+ RUN git clone https://github.com/holiman/goevmlab --depth 1
27+ RUN cd goevmlab && \
28+ go build ./cmd/generic-fuzzer && \
29+ go build ./cmd/generic-generator && \
30+ go build ./cmd/checkslow && \
31+ go build ./cmd/minimizer && \
32+ go build ./cmd/repro && \
33+ go build ./cmd/runtest && \
34+ go build ./cmd/tracediff && \
35+ go build ./cmd/traceview && \
36+ go test -c ./evms
37+ #
38+ # GETH
39+ #
40+
41+ RUN git clone https://github.com/ethereum/go-ethereum --depth 1
42+ RUN cd go-ethereum && go run build/ci.go install -static ./cmd/evm
43+
44+ #
45+ # Erigon
46+ #
47+ RUN git clone https://github.com/ledgerwatch/erigon --depth 1
48+ RUN cd erigon && mkdir /erigon/ && make evm && \
49+ cp ./build/bin/evm /erigon_vm && \
50+ cp $(bash ./turbo/silkworm/silkworm_lib_path.sh) /libsilkworm_capi.so
51+
52+
53+ #
54+ # NIMBUS-ETH1
55+ #
56+
57+ RUN apt-get update -q && apt-get install -qy --no-install-recommends make
58+ RUN git clone https://github.com/status-im/nimbus-eth1.git --depth 1 --recurse-submodules && \
59+ cd nimbus-eth1 && make -j8 update && \
60+ make -j8 evmstate && cp ./tools/evmstate/evmstate /evmstate
61+
62+
63+ # ---------------------------------------------------------------
64+ # debian-builder
65+ # ---------------------------------------------------------------
66+
67+ #
68+ # EVMONE
69+ #
70+ #
71+ # evmone requires g++ v13, which is _not_ available in debian bookworm (the golang image)
72+ # but it works with debian:testing (at the time of writing this)
73+
74+ FROM debian:testing as debian-builder
75+ RUN apt-get update -q && apt-get install -qy --no-install-recommends git make \
76+ ca-certificates g++ cmake ninja-build libgmp-dev
77+
78+ RUN git clone https://github.com/ethereum/evmone.git --depth 1 --recurse-submodules
79+ RUN cd evmone && cmake -S . -B build -DEVMONE_TESTING=ON -DEVMONE_PRECOMPILES_SILKPRE=1
80+ RUN cd evmone && cmake --build build --parallel
81+ RUN cp /evmone/build/bin/evmone-statetest /evmone-statetest
82+ RUN ls -la /evmone/build/lib/libevmone.so.*
83+ RUN cp /evmone/build/lib/libevmone.so.* /
84+ # ---------------------------------------------------------------
85+ # rust-builder
86+ # ---------------------------------------------------------------
87+
88+ #
89+ # RETH
90+ #
91+
92+ FROM lukemathwalker/cargo-chef:latest-rust-1 AS rust-builder
93+ RUN apt-get update -q && apt-get install -qy --no-install-recommends libclang-dev pkg-config
94+ RUN git clone https://github.com/bluealloy/revm.git --depth 1
95+ RUN cd revm && cargo build --release --package revme
96+
97+
98+ # ---------------------------------------------------------------
99+ # dotnet-builder
100+ # ---------------------------------------------------------------
101+
102+
103+ #
104+ # NETHERMIND
105+ #
106+
107+ FROM mcr.microsoft.com/dotnet/sdk:9.0-noble AS dotnet-builder
108+ RUN git clone https://github.com/NethermindEth/nethermind --depth 1
109+
110+ RUN cd nethermind/src/Nethermind/Nethermind.Test.Runner && dotnet publish --self-contained true -r linux-x64 -c Release
111+ RUN mkdir /out && mv nethermind/src/Nethermind/artifacts/bin/Nethermind.Test.Runner/release_linux-x64 /out/neth
112+
113+ # also txparse
114+ RUN cd nethermind/tools/TxParser && dotnet publish --self-contained true -r linux-x64 -c Release
115+ # winds up at /out/neth/TxParser
116+ RUN cp -rT /nethermind/tools/artifacts/publish/TxParser/release_linux-x64/ /out/neth/
117+
118+ # ---------------------------------------------------------------
119+ # java-builder
120+ # ---------------------------------------------------------------
121+
122+ #
123+ # BESU
124+ #
125+
126+ FROM ubuntu:24.04 as java-builder
127+
128+ RUN apt-get update -q && apt-get install -qy --no-install-recommends git ca-certificates \
129+ openjdk-21-jdk-headless=21* libjemalloc-dev=5.*
130+ RUN git clone https://github.com/hyperledger/besu.git --depth 1 #--recurse-submodules
131+ RUN cd besu && ./gradlew --parallel ethereum:evmtool:installDist
132+ RUN mkdir /out && mv besu/ethereum/evmtool/build/install/evmtool /out/evmtool
133+
134+ #
135+ # Main non-builder
136+ #
137+
138+ FROM debian:testing
139+
140+ # nethtest requires libssl-dev
141+ # besu requires openjdk-21-jre
142+ # evmone requires GLIBC_2.38 (libstdc++-13-dev) (https://github.com/holiman/goevmlab/issues/144)
143+ # EELS requires (see https://github.com/ethereum/execution-specs/issues/976)
144+ # - pipx, git,
145+ # - curl (for installing rust),
146+ # - gcc for building 'py-arkworks-bls12381',
147+ # - python3-dev for bulding 'lru-dict'
148+ # - pkg-config (see https://github.com/ethereum/execution-specs/issues/1103)
149+ RUN apt-get update -q && \
150+ apt-get install -qy --no-install-recommends \
151+ libssl-dev \
152+ openjdk-21-jre-headless \
153+ libstdc++-13-dev \
154+ pipx git curl gcc python3-dev pkg-config \
155+ jq nano \
156+ && apt-get clean
157+
158+ # Install execution-specs (EELS)
159+ RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile=minimal
160+ RUN git clone https://github.com/ethereum/execution-specs.git --branch forks/prague --depth 1
161+ RUN . "$HOME/.cargo/env" ; PIPX_HOME=/opt/pipx PIPX_BIN_DIR=/ pipx install './execution-specs/[test]'
162+ ENV EELS_BIN=/ethereum-spec-evm
163+
164+ # Go-evmlab targets
165+ COPY --from=golang-builder /go/goevmlab/generic-fuzzer \
166+ /go/goevmlab/generic-generator \
167+ /go/goevmlab/checkslow \
168+ /go/goevmlab/minimizer \
169+ /go/goevmlab/repro \
170+ /go/goevmlab/runtest \
171+ /go/goevmlab/tracediff \
172+ /go/goevmlab/traceview \
173+ /go/goevmlab/evms.test \
174+ /usr/bin/
175+
176+ COPY --from=golang-builder /go/go-ethereum/build/bin/evm /gethvm
177+ ENV GETH_BIN=/gethvm
178+
179+ COPY --from=golang-builder /erigon_vm /erigon_vm
180+ COPY --from=golang-builder /libsilkworm_capi.so /lib/libsilkworm_capi.so
181+ ENV ERIG_BIN=/erigon_vm
182+
183+ COPY --from=golang-builder /evmstate /nimbvm
184+ ENV NIMB_BIN=/nimbvm
185+
186+ COPY --from=debian-builder /evmone-statetest /evmone
187+ COPY --from=debian-builder /libevmone.so.* /lib/
188+ ENV EVMO_BIN=/evmone
189+
190+ COPY --from=rust-builder /revm/target/release/revme /revme
191+ ENV RETH_BIN=/revme
192+
193+ COPY --from=dotnet-builder /out/neth /neth
194+ RUN ln -s /neth/nethtest /nethtest
195+ ENV NETH_BIN=/neth/nethtest
196+
197+ COPY --from=java-builder /out/evmtool /evmtool
198+ RUN ln -s /evmtool/bin/evmtool besu-vm
199+ ENV BESU_BIN=/evmtool/bin/evmtool
200+
201+ COPY readme_docker.md /README.md
202+
203+ ENV FUZZ_CLIENTS="--gethbatch=$GETH_BIN \
204+ --nethbatch=$NETH_BIN \
205+ --nimbusbatch=$NIMB_BIN \
206+ --revme=$RETH_BIN \
207+ --erigonbatch=$ERIG_BIN \
208+ --besubatch=$BESU_BIN \
209+ --evmone=$EVMO_BIN \
210+ --eelsbatch=$EELS_BIN"
211+
212+ ENV FUZZ_CLIENTS_PLAIN="--geth=$GETH_BIN \
213+ --neth=$NETH_BIN \
214+ --nimbus=$NIMB_BIN \
215+ --revme=$RETH_BIN \
216+ --erigon=$ERIG_BIN \
217+ --besu=$BESU_BIN \
218+ --evmone=$EVMO_BIN \
219+ --eels=$EELS_BIN"
220+
221+ ENTRYPOINT ["/bin/bash" ]
0 commit comments