Skip to content

Commit 03832b0

Browse files
authored
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 <kevtheappdev@gmail.com>
1 parent 0d0232e commit 03832b0

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

Dockerfile.dev

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
FROM rust:1.88.0-bullseye AS builder
2+
RUN apt-get update && apt-get -y upgrade && apt-get install -y cmake libclang-dev
3+
WORKDIR /lighthouse
4+
5+
ARG FEATURES
6+
ARG PROFILE=release
7+
ARG CARGO_USE_GIT_CLI=true
8+
ENV FEATURES=$FEATURES
9+
ENV PROFILE=$PROFILE
10+
ENV CARGO_NET_GIT_FETCH_WITH_CLI=$CARGO_USE_GIT_CLI
11+
ENV CARGO_INCREMENTAL=1
12+
13+
COPY . .
14+
# Persist the registry and target file across builds. See: https://docs.docker.com/build/cache/optimize/#use-cache-mounts
15+
RUN --mount=type=cache,target=/usr/local/cargo/registry \
16+
--mount=type=cache,target=/lighthouse/target \
17+
make
18+
19+
FROM ubuntu:22.04
20+
RUN apt-get update && apt-get -y upgrade && apt-get install -y --no-install-recommends \
21+
libssl-dev \
22+
ca-certificates \
23+
&& apt-get clean \
24+
&& rm -rf /var/lib/apt/lists/*
25+
COPY --from=builder /usr/local/cargo/bin/lighthouse /usr/local/bin/lighthouse

0 commit comments

Comments
 (0)