apache-opendal
SUCCESS
26m 13s
History Source
SummaryIterations1Transcript11Dockerfile
Dockerfile55 lines · 1368 chars
# Multi-stage Dockerfile for building Apache OpenDAL from source
# Stage 1: Build the Rust crates with a Rust toolchain
FROM rust:1.85-bullseye AS builder

# Non-interactive apt installs
ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update \
    && apt-get install -y --no-install-recommends \
        build-essential \
        cmake \
        pkg-config \
        libssl-dev \
        libsnappy-dev \
        zlib1g-dev \
        libbz2-dev \
        librocksdb-dev \
        ca-certificates \
        curl \
        git \
        unzip \
        clang \
        libclang-dev \
        libclang1 \
        llvm \
    && rm -rf /var/lib/apt/lists/*

# Copy the repository and build
WORKDIR /workspace
COPY . /workspace

# Build the Rust crate with default features (faster for smoke tests)
RUN cd core && cargo build --locked

# Stage 2: Runtime image
FROM debian:bookworm-slim AS runtime

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update \
    && apt-get install -y --no-install-recommends \
        bash \
        ca-certificates \
        libgcc1 \
        libstdc++6 \
    && rm -rf /var/lib/apt/lists/*

# Copy built artifacts from the builder stage
COPY --from=builder /workspace/core/target /workspace/core/target

WORKDIR /workspace

# Default to a shell; this container is intended for inspection/usage rather than a specific daemon
CMD ["/bin/bash"]