generated from NethermindEth/rust-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
39 lines (29 loc) · 1.1 KB
/
Dockerfile
File metadata and controls
39 lines (29 loc) · 1.1 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
# Use the official Ubuntu image as the base
FROM ubuntu:24.04 AS builder
ARG GIT_COMMIT_HASH_SHORT
ENV GIT_COMMIT_HASH_SHORT=${GIT_COMMIT_HASH_SHORT}
ARG SOURCE_DATE_EPOCH
ENV SOURCE_DATE_EPOCH=${SOURCE_DATE_EPOCH}
# Install necessary system dependencies for Rust compilation
RUN apt-get update && \
apt-get install -y curl build-essential pkg-config \
openssl libssl-dev \
protobuf-compiler=3.21.12*
# Install Rust using rustup, the official installer
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain 1.89.0
ENV PATH="/root/.cargo/bin:${PATH}"
# Install Rust dependencies
RUN cargo install oas3-gen@0.24.0
# Build the Pluto CLI
WORKDIR /build
COPY . .
RUN cargo build --locked --release --package pluto-cli
FROM ubuntu:24.04 AS app
# Install runtime dependencies for TLS/HTTPS
RUN apt-get update && \
apt-get install -y ca-certificates libssl3 && \
apt-get clean && rm -rf /var/lib/apt/lists/*
# Copy the compiled binary from the builder stage
COPY --from=builder /build/target/release/pluto /app/bin/pluto
# Run the Pluto CLI
ENTRYPOINT ["/app/bin/pluto"]