freenet/Dockerfile
Merith-TK 1ef69c170f
All checks were successful
Build Docker Image on Commit / build-and-publish (push) Successful in 1m53s
Fix builder to multistep for small size
2025-04-21 17:30:59 +00:00

40 lines
No EOL
1.1 KiB
Docker

# Stage 1: Builder
FROM rust:slim-bookworm AS builder
# Install system dependencies
RUN apt-get update && \
apt-get install -y --no-install-recommends \
git \
clang \
llvm \
libclang-dev \
libssl-dev \
pkg-config \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
# First clone without submodules
WORKDIR /src
RUN git clone --depth 1 https://github.com/freenet/freenet-core.git freenet
# Change submodule URLs from SSH to HTTPS
WORKDIR /src/freenet
RUN sed -i 's|git@github.com:|https://github.com/|' .gitmodules && \
git submodule sync && \
git submodule update --init --recursive
# Build the core crate (correct package specification)
WORKDIR /src/freenet/crates/core
RUN cargo build --release
# Stage 2: Runner
FROM debian:bookworm-slim
RUN apt-get update && \
apt-get install -y --no-install-recommends \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
# Copy the compiled binary
COPY --from=builder /src/freenet/target/release/freenet /usr/local/bin/freenet
CMD ["freenet", "-b", "0.0.0.0"]