chore: Use cargo-chef to build the hivetests docker image (#14884)

Co-authored-by: Emilia Hane <elsaemiliaevahane@gmail.com>
This commit is contained in:
Ján Jakub Naništa
2025-03-11 07:52:36 -07:00
committed by GitHub
parent cdc6136999
commit 4920ad6dbe
4 changed files with 66 additions and 18 deletions

View File

@@ -1,3 +1,5 @@
# syntax=docker.io/docker/dockerfile:1.7-labs
FROM lukemathwalker/cargo-chef:latest-rust-1 AS chef
WORKDIR /app
@@ -9,7 +11,7 @@ RUN apt-get update && apt-get -y upgrade && apt-get install -y libclang-dev pkg-
# Builds a cargo-chef plan
FROM chef AS planner
COPY . .
COPY --exclude=.git --exclude=dist . .
RUN cargo chef prepare --recipe-path recipe.json
FROM chef AS builder
@@ -31,7 +33,7 @@ ENV FEATURES=$FEATURES
RUN cargo chef cook --profile $BUILD_PROFILE --features "$FEATURES" --recipe-path recipe.json
# Build application
COPY . .
COPY --exclude=.git --exclude=dist . .
RUN cargo build --profile $BUILD_PROFILE --features "$FEATURES" --locked --bin reth
# ARG is not resolved in COPY so we have to hack around it by copying the