-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
45 lines (36 loc) · 1.45 KB
/
Dockerfile
File metadata and controls
45 lines (36 loc) · 1.45 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
# --- Builder Stage ---
# Use a specific Debian version (Bookworm) for consistency
FROM rust:1.86-bookworm AS builder
WORKDIR /usr/src/subeth-rpc-adapter
# Install build dependencies - NO musl-tools needed
RUN apt-get update && apt-get install -y \
libssl-dev \
ca-certificates \
protobuf-compiler \
# clang or gcc is fine, cc-rs usually detects correctly
clang \
pkg-config \
&& rm -rf /var/lib/apt/lists/*
# Copy workspace files
COPY Cargo.toml Cargo.lock ./
COPY adapter ./adapter
COPY chain ./chain
COPY artifacts ./artifacts
COPY specs ./specs
# Standard release build, links against glibc in the builder
# Add --verbose if you need more build output details
RUN cargo build --release --verbose -p subeth
# --- Final Stage ---
# Use the corresponding minimal Debian version
FROM debian:bookworm-slim
# Install runtime dependencies if any (e.g., libssl if not statically linked by openssl-sys feature)
# Check if your app needs libssl at runtime: ldd target/release/subeth-rpc-adapter in builder
# If it lists libssl.so, uncomment the next line:
# RUN apt-get update && apt-get install -y libssl3 && rm -rf /var/lib/apt/lists/*
# Copy necessary files from the builder
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=builder /usr/src/subeth-rpc-adapter/target/release/subeth /usr/local/bin/subeth-rpc-adapter
# Set the entrypoint
ENTRYPOINT ["/usr/local/bin/subeth-rpc-adapter"]
# Expose the port
EXPOSE 8545