Commit 81a04c19 authored by Matthew Slipper's avatar Matthew Slipper Committed by GitHub

Merge pull request #7918 from ethereum-optimism/cl/rustc-ci

feat(ci-builder): Persist Rust toolchain in final image
parents 0f49412c 53a60ced
...@@ -12,6 +12,9 @@ RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > rustup.sh && \ ...@@ -12,6 +12,9 @@ RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > rustup.sh && \
chmod +x ./rustup.sh && \ chmod +x ./rustup.sh && \
./rustup.sh -y ./rustup.sh -y
# Install nightly toolchain
RUN source $HOME/.profile && rustup update nightly
RUN source $HOME/.profile && cargo install just RUN source $HOME/.profile && cargo install just
RUN source $HOME/.profile && cargo install svm-rs RUN source $HOME/.profile && cargo install svm-rs
...@@ -59,8 +62,12 @@ FROM --platform=linux/amd64 python:3.11.4-slim-bullseye ...@@ -59,8 +62,12 @@ FROM --platform=linux/amd64 python:3.11.4-slim-bullseye
ENV GOPATH=/go ENV GOPATH=/go
ENV PATH=/usr/local/go/bin:$GOPATH/bin:$PATH ENV PATH=/usr/local/go/bin:$GOPATH/bin:$PATH
ENV PATH=/root/.cargo/bin:$PATH
ENV DEBIAN_FRONTEND=noninteractive ENV DEBIAN_FRONTEND=noninteractive
# Create rust directories for copying the installation into
RUN mkdir /root/.cargo && mkdir /root/.cargo/bin && mkdir /root/.rustup
# copy the go installation, but not the module cache (cache will get stale, and would add a lot of weight) # copy the go installation, but not the module cache (cache will get stale, and would add a lot of weight)
COPY --from=go-build /usr/local/go /usr/local/go COPY --from=go-build /usr/local/go /usr/local/go
# copy tools # copy tools
...@@ -69,11 +76,15 @@ COPY --from=go-build /go/bin/mockery /go/bin/mockery ...@@ -69,11 +76,15 @@ COPY --from=go-build /go/bin/mockery /go/bin/mockery
COPY --from=go-build /go/bin/golangci-lint /go/bin/golangci-lint COPY --from=go-build /go/bin/golangci-lint /go/bin/golangci-lint
COPY --from=go-build /go/bin/abigen /usr/local/bin/abigen COPY --from=go-build /go/bin/abigen /usr/local/bin/abigen
COPY --from=go-build /go/bin/geth /usr/local/bin/geth COPY --from=go-build /go/bin/geth /usr/local/bin/geth
COPY --from=rust-build /root/.cargo/bin/svm /usr/local/bin/svm
COPY --from=rust-build /root/.cargo/bin/just /usr/local/bin/just # copy the rust installation, alongside the installed toolchains
COPY --from=rust-build /root/.cargo/bin /root/.cargo/bin
COPY --from=rust-build /root/.rustup /root/.rustup
# copy tools
COPY --from=rust-build /opt/foundry/target/release/forge /usr/local/bin/forge COPY --from=rust-build /opt/foundry/target/release/forge /usr/local/bin/forge
COPY --from=rust-build /opt/foundry/target/release/cast /usr/local/bin/cast COPY --from=rust-build /opt/foundry/target/release/cast /usr/local/bin/cast
COPY --from=rust-build /opt/foundry/target/release/anvil /usr/local/bin/anvil COPY --from=rust-build /opt/foundry/target/release/anvil /usr/local/bin/anvil
COPY --from=echidna-test /usr/local/bin/echidna-test /usr/local/bin/echidna-test COPY --from=echidna-test /usr/local/bin/echidna-test /usr/local/bin/echidna-test
COPY .nvmrc .nvmrc COPY .nvmrc .nvmrc
...@@ -84,7 +95,7 @@ ENV SLITHER_VERSION=0.10.0 ...@@ -84,7 +95,7 @@ ENV SLITHER_VERSION=0.10.0
# note: python3 package in apt is python 3.9, while base image already has python 3.11 # note: python3 package in apt is python 3.9, while base image already has python 3.11
RUN /bin/sh -c set -eux; \ RUN /bin/sh -c set -eux; \
apt-get update; \ apt-get update; \
apt-get install -y --no-install-recommends bash curl openssh-client git build-essential ca-certificates jq gnupg binutils-mips-linux-gnu; \ apt-get install -y --no-install-recommends bash curl openssh-client git build-essential pkg-config libssl-dev clang libclang-dev ca-certificates jq gnupg binutils-mips-linux-gnu; \
mkdir -p /etc/apt/keyrings; \ mkdir -p /etc/apt/keyrings; \
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg; \ curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg; \
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list; \ echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list; \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment