-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathDockerfile.debug
More file actions
53 lines (39 loc) · 1.54 KB
/
Dockerfile.debug
File metadata and controls
53 lines (39 loc) · 1.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# Fast debug build Dockerfile for bera-reth development
# Uses same cargo-chef pattern as production but with debug profile
FROM lukemathwalker/cargo-chef:latest-rust-1 AS chef
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get -y upgrade && apt-get install -y libclang-dev pkg-config
# Builds a cargo-chef plan
FROM chef AS planner
COPY . .
RUN cargo chef prepare --recipe-path recipe.json
FROM chef AS builder
COPY --from=planner /app/recipe.json recipe.json
# Use dev profile for faster builds (Cargo's debug profile)
ARG BUILD_PROFILE=release
ENV BUILD_PROFILE=$BUILD_PROFILE
# Builds dependencies with debug profile (faster linking, keeps symbols)
RUN cargo chef cook --profile $BUILD_PROFILE --recipe-path recipe.json
# Build application
COPY . .
RUN cargo build --profile $BUILD_PROFILE --locked --bin bera-reth
# Copy binary from debug directory (release profile builds to release dir)
RUN cp /app/target/release/bera-reth /app/bera-reth
# Use Ubuntu as the release image
FROM ubuntu:24.04 AS runtime
# Install runtime dependencies
RUN apt-get update && \
apt-get install -y ca-certificates libssl-dev && \
rm -rf /var/lib/apt/lists/*
# Copy bera-reth over from the build stage
COPY --from=builder /app/bera-reth /usr/local/bin/
RUN chmod +x /usr/local/bin/bera-reth
# Copy licenses
COPY LICENSE ./
# Expose standard Ethereum execution client ports
EXPOSE 30303 30303/udp 9001 8545 8546 8551
# Set environment to show we're in debug mode
ENV RUST_LOG=debug
ENV BUILD_TYPE=release
ENTRYPOINT ["/usr/local/bin/bera-reth"]