Skip to content

Commit 6a2a361

Browse files
authored
fix(base-reth): add mold linker (#992)
1 parent 23ffb27 commit 6a2a361

File tree

1 file changed

+29
-4
lines changed

1 file changed

+29
-4
lines changed

reth/Dockerfile

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
ARG RUST_VERSION=1.93
2+
13
FROM golang:1.24 AS op
24

35
RUN curl -sSfL 'https://just.systems/install.sh' | bash -s -- --to /usr/local/bin
@@ -13,16 +15,39 @@ RUN . /tmp/versions.env && git clone $OP_NODE_REPO --branch $OP_NODE_TAG --singl
1315
RUN . /tmp/versions.env && cd op-node && \
1416
make VERSION=$OP_NODE_TAG op-node
1517

16-
FROM rust:1.88 AS reth-base
18+
FROM public.ecr.aws/docker/library/rust:${RUST_VERSION}-trixie AS rust-builder-base
1719

1820
WORKDIR /app
1921

20-
COPY versions.env /tmp/versions.env
22+
ARG MOLD_VERSION=2.40.4
23+
ARG MOLD_SHA256_AARCH64=c799b9ccae8728793da2186718fbe53b76400a9da396184fac0c64aa3298ec37
24+
ARG MOLD_SHA256_ARM=d82792748a81202423ddd2496fc8719404fe694493abdef691cc080392ee44bf
25+
ARG MOLD_SHA256_X86_64=4c999e19ffa31afa5aa429c679b665d5e2ca5a6b6832ad4b79668e8dcf3d8ec1
2126

22-
RUN apt-get update && apt-get -y upgrade && \
23-
apt-get install -y git libclang-dev pkg-config curl build-essential && \
27+
RUN apt-get update && \
28+
apt-get install -y --no-install-recommends \
29+
git libclang-dev pkg-config curl build-essential cmake && \
2430
rm -rf /var/lib/apt/lists/*
2531

32+
RUN set -eux; \
33+
case "$(uname -m)" in \
34+
x86_64) MOLD_ARCH=x86_64; MOLD_SHA256="${MOLD_SHA256_X86_64}" ;; \
35+
aarch64|arm64) MOLD_ARCH=aarch64; MOLD_SHA256="${MOLD_SHA256_AARCH64}" ;; \
36+
armv7l|armv6l) MOLD_ARCH=arm; MOLD_SHA256="${MOLD_SHA256_ARM}" ;; \
37+
*) echo "unsupported architecture: $(uname -m)" >&2; exit 1 ;; \
38+
esac; \
39+
curl -fsSL "https://github.com/rui314/mold/releases/download/v${MOLD_VERSION}/mold-${MOLD_VERSION}-${MOLD_ARCH}-linux.tar.gz" -o /tmp/mold.tar.gz; \
40+
echo "${MOLD_SHA256} /tmp/mold.tar.gz" | sha256sum -c -; \
41+
tar -xzf /tmp/mold.tar.gz -C /tmp; \
42+
cp /tmp/mold-${MOLD_VERSION}-${MOLD_ARCH}-linux/bin/* /usr/local/bin/; \
43+
rm -rf /tmp/mold*
44+
45+
FROM rust-builder-base AS reth-base
46+
47+
WORKDIR /app
48+
49+
COPY versions.env /tmp/versions.env
50+
2651
RUN . /tmp/versions.env && git clone $BASE_RETH_NODE_REPO . && \
2752
git checkout tags/$BASE_RETH_NODE_TAG && \
2853
bash -c '[ "$(git rev-parse HEAD)" = "$BASE_RETH_NODE_COMMIT" ]' || (echo "Commit hash verification failed" && exit 1)

0 commit comments

Comments
 (0)