done
This commit is contained in:
@@ -39,6 +39,8 @@ services:
|
|||||||
context: ./
|
context: ./
|
||||||
dockerfile: reth.Dockerfile
|
dockerfile: reth.Dockerfile
|
||||||
args:
|
args:
|
||||||
|
LLVM_IMAGE: ${LLVM_IMAGE:-snowstep/llvm}
|
||||||
|
LLVM_VERSION: ${LLVM_VERSION:-20250514100911}
|
||||||
RETH_VERSION: ${ETHEREUM_MAINNET_RETH_VERSION:-v1.4.3}
|
RETH_VERSION: ${ETHEREUM_MAINNET_RETH_VERSION:-v1.4.3}
|
||||||
RETH_REPO: ${ETHEREUM_MAINNET_RETH_REPO:-https://github.com/paradigmxyz/reth}
|
RETH_REPO: ${ETHEREUM_MAINNET_RETH_REPO:-https://github.com/paradigmxyz/reth}
|
||||||
ARCH_TARGET: ${ARCH_TARGET:-native}
|
ARCH_TARGET: ${ARCH_TARGET:-native}
|
||||||
|
|||||||
@@ -1,30 +1,24 @@
|
|||||||
# Multi-stage build for reth with architecture-specific optimizations
|
# Multi-stage build for reth with architecture-specific optimizations
|
||||||
FROM rust:1.83-bookworm as builder
|
ARG LLVM_IMAGE=snowstep/llvm
|
||||||
|
ARG LLVM_VERSION=20250514100911
|
||||||
|
FROM ${LLVM_IMAGE}:${LLVM_VERSION} as builder
|
||||||
|
|
||||||
# Install nightly toolchain for advanced optimizations
|
# Install Rust and nightly toolchain for advanced optimizations
|
||||||
|
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable --profile minimal
|
||||||
|
ENV PATH="/root/.cargo/bin:${PATH}"
|
||||||
RUN rustup toolchain install nightly && \
|
RUN rustup toolchain install nightly && \
|
||||||
rustup component add rust-src --toolchain nightly
|
rustup component add rust-src --toolchain nightly
|
||||||
|
|
||||||
# Install build dependencies
|
# Install additional build dependencies
|
||||||
RUN apt-get update && apt-get install -y \
|
RUN apt-get update && apt-get install -y \
|
||||||
git \
|
git \
|
||||||
cmake \
|
|
||||||
make \
|
|
||||||
libssl-dev \
|
libssl-dev \
|
||||||
pkg-config \
|
pkg-config \
|
||||||
wget \
|
wget \
|
||||||
gnupg \
|
|
||||||
software-properties-common \
|
|
||||||
ninja-build \
|
ninja-build \
|
||||||
ccache \
|
ccache \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
# Install latest LLVM 20.1.5 from official releases for maximum optimization
|
|
||||||
RUN wget https://github.com/llvm/llvm-project/releases/download/llvmorg-20.1.5/clang+llvm-20.1.5-x86_64-linux-gnu.tar.xz && \
|
|
||||||
tar xf clang+llvm-20.1.5-x86_64-linux-gnu.tar.xz && \
|
|
||||||
cp -r clang+llvm-20.1.5-x86_64-linux-gnu/* /usr/local/ && \
|
|
||||||
rm -rf clang+llvm-20.1.5-x86_64-linux-gnu*
|
|
||||||
|
|
||||||
# Install mold linker (faster than lld)
|
# Install mold linker (faster than lld)
|
||||||
RUN wget https://github.com/rui314/mold/releases/download/v2.30.0/mold-2.30.0-x86_64-linux.tar.gz && \
|
RUN wget https://github.com/rui314/mold/releases/download/v2.30.0/mold-2.30.0-x86_64-linux.tar.gz && \
|
||||||
tar xf mold-2.30.0-x86_64-linux.tar.gz && \
|
tar xf mold-2.30.0-x86_64-linux.tar.gz && \
|
||||||
@@ -68,11 +62,12 @@ WORKDIR /build
|
|||||||
RUN git clone $RETH_REPO . && \
|
RUN git clone $RETH_REPO . && \
|
||||||
git checkout $RETH_VERSION
|
git checkout $RETH_VERSION
|
||||||
|
|
||||||
# Set environment variables for optimization with LLVM 20.1.5
|
# Set environment variables for optimization
|
||||||
ENV CC=/usr/local/bin/clang
|
# The snowstep/llvm image already has clang and LLVM tools in PATH
|
||||||
ENV CXX=/usr/local/bin/clang++
|
ENV CC=clang
|
||||||
ENV AR=/usr/local/bin/llvm-ar
|
ENV CXX=clang++
|
||||||
ENV RANLIB=/usr/local/bin/llvm-ranlib
|
ENV AR=llvm-ar
|
||||||
|
ENV RANLIB=llvm-ranlib
|
||||||
ENV LD=/usr/local/bin/mold
|
ENV LD=/usr/local/bin/mold
|
||||||
ENV SCCACHE_DIR=/tmp/sccache
|
ENV SCCACHE_DIR=/tmp/sccache
|
||||||
ENV RUSTC_WRAPPER=/usr/local/bin/sccache
|
ENV RUSTC_WRAPPER=/usr/local/bin/sccache
|
||||||
|
|||||||
Reference in New Issue
Block a user