-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathDockerfile
30 lines (22 loc) · 875 Bytes
/
Dockerfile
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
# Use the official Rust image as the base image
FROM rust:1.81 AS builder
# Install protobuf compiler
RUN apt-get update && apt-get install -y protobuf-compiler git
# Create a new directory for the application
WORKDIR /app
# Clone the repository instead of copying local files
RUN git clone https://github.com/lndk-org/lndk .
# Build dependencies and the project
RUN cargo build --release
# Create a new stage with a minimal image
FROM debian:bookworm-slim AS final
# Install necessary runtime dependencies
RUN apt-get update && \
apt-get install -y libssl3 ca-certificates && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Copy the built executables from the builder stage
COPY --from=builder /app/target/release/lndk /usr/local/bin/lndk
COPY --from=builder /app/target/release/lndk-cli /usr/local/bin/lndk-cli
# Set the startup command
CMD ["lndk"]