From 0198cbbd70dbe334b6ae73931af40a58a9b31a59 Mon Sep 17 00:00:00 2001 From: Alcibiades Athens Date: Mon, 13 Nov 2023 18:44:39 -0500 Subject: [PATCH] just use foundryup for now because build is mercurial --- Dockerfile | 51 +++------------------------------------------------ 1 file changed, 3 insertions(+), 48 deletions(-) diff --git a/Dockerfile b/Dockerfile index 26fc559..530abda 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,58 +1,13 @@ -FROM lukemathwalker/cargo-chef:latest-rust-1.72.1 as chef -WORKDIR /opt - -FROM chef as planner - -# Get the foundry project -RUN git clone https://github.com/foundry-rs/foundry.git - -WORKDIR /opt/foundry - -# Compute a lock-like file for our project -RUN cargo chef prepare --recipe-path recipe.json - -FROM chef as builder - -WORKDIR /opt/foundry - -# Get the foundry project -COPY --from=planner /opt/foundry /opt/foundry -# Get the lock-like file -COPY --from=planner /opt/foundry/recipe.json recipe.json - -RUN apt-get update -y && apt-get install -y gcc-aarch64-linux-gnu linux-headers-generic -RUN apt-get clean && rm -rf /var/lib/apt/lists/* - -# Build our project dependencies, not our application! -RUN cargo chef cook --release --recipe-path recipe.json -# Up to this point, if our dependency tree stays the same, -# all layers should be cached. - -# Conditional for cross compliation -RUN CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc CFLAGS=-mno-outline-atomics cargo build --release --bins --target aarch64-unknown-linux-gnu - -# Strip any debug symbols -RUN strip /opt/foundry/target/release/forge \ - && strip /opt/foundry/target/release/cast \ - && strip /opt/foundry/target/release/anvil \ - && strip /opt/foundry/target/release/chisel - FROM debian:bookworm-slim AS foundry-environment -RUN apt-get update -y && apt-get install -y linux-headers-generic git +RUN apt-get update -y && apt-get install -y linux-headers-generic git curl bash RUN apt-get clean && rm -rf /var/lib/apt/lists/* -# Foundry tools -COPY --from=builder /opt/foundry/target/release/forge /usr/local/bin/forge -COPY --from=builder /opt/foundry/target/release/cast /usr/local/bin/cast -COPY --from=builder /opt/foundry/target/release/anvil /usr/local/bin/anvil -COPY --from=builder /opt/foundry/target/release/chisel /usr/local/bin/chisel - RUN useradd -u 1000 -m foundry USER foundry -# TODO(User and group here) +curl -L https://foundry.paradigm.xyz | bash ENTRYPOINT ["/bin/sh", "-c"] @@ -63,4 +18,4 @@ FROM foundry-environment as anvil # Start a clean anvil chain EXPOSE 8545 -ENTRYPOINT ["/usr/local/bin/anvil"] +ENTRYPOINT ["anvil"]