From 03832b0ad2ffc49a6e3084d35465c8bf5d542a75 Mon Sep 17 00:00:00 2001 From: kevaundray Date: Mon, 24 Nov 2025 02:40:20 -0300 Subject: [PATCH] chore: Add Dockerfile.dev for local development (#8295) Currently whenever we build the `Dockerfile` file for local development using kurtosis , it recompiles everything on my laptop, even if no changes are made. This takes about 120 seconds on my laptop (might be faster on others). Conservatively, I created a new Dockerfile.dev, so that the original file is kept the same, even though its pretty similar. This uses `--mount-type=cache` saving the target and registry folder across builds. **Usage** ```sh docker build -f Dockerfile.dev -t lighthouse:dev . ``` Co-Authored-By: Kevaundray Wedderburn --- Dockerfile.dev | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 Dockerfile.dev diff --git a/Dockerfile.dev b/Dockerfile.dev new file mode 100644 index 0000000000..50bf1e5898 --- /dev/null +++ b/Dockerfile.dev @@ -0,0 +1,25 @@ +FROM rust:1.88.0-bullseye AS builder +RUN apt-get update && apt-get -y upgrade && apt-get install -y cmake libclang-dev +WORKDIR /lighthouse + +ARG FEATURES +ARG PROFILE=release +ARG CARGO_USE_GIT_CLI=true +ENV FEATURES=$FEATURES +ENV PROFILE=$PROFILE +ENV CARGO_NET_GIT_FETCH_WITH_CLI=$CARGO_USE_GIT_CLI +ENV CARGO_INCREMENTAL=1 + +COPY . . +# Persist the registry and target file across builds. See: https://docs.docker.com/build/cache/optimize/#use-cache-mounts +RUN --mount=type=cache,target=/usr/local/cargo/registry \ + --mount=type=cache,target=/lighthouse/target \ + make + +FROM ubuntu:22.04 +RUN apt-get update && apt-get -y upgrade && apt-get install -y --no-install-recommends \ + libssl-dev \ + ca-certificates \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* +COPY --from=builder /usr/local/cargo/bin/lighthouse /usr/local/bin/lighthouse \ No newline at end of file