File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # Multi-stage Docker build for datafusion-cli
2+ # Build stage
3+ FROM rust:1.86-slim as builder
4+
5+ # Install system dependencies needed for building
6+ RUN apt-get update && apt-get install -y \
7+ pkg-config \
8+ libssl-dev \
9+ && rm -rf /var/lib/apt/lists/*
10+
11+ # Set working directory
12+ WORKDIR /usr/src/datafusion
13+
14+ # Copy Cargo files first for better layer caching
15+ COPY Cargo.toml Cargo.lock ./
16+ COPY datafusion/ ./datafusion/
17+ COPY datafusion-cli/ ./datafusion-cli/
18+ COPY datafusion-examples/ ./datafusion-examples/
19+ COPY test-utils/ ./test-utils/
20+ COPY benchmarks/ ./benchmarks/
21+
22+ # Build the datafusion-cli binary in release mode
23+ RUN cargo build --release --bin datafusion-cli
24+
25+ # Runtime stage
26+ FROM debian:bookworm-slim
27+
28+ # Install runtime dependencies
29+ RUN apt-get update && apt-get install -y \
30+ ca-certificates \
31+ && rm -rf /var/lib/apt/lists/*
32+
33+ # Copy the binary from builder stage
34+ COPY --from=builder /usr/src/datafusion/target/release/datafusion-cli /usr/local/bin/datafusion-cli
35+
36+ # Set the binary as executable
37+ RUN chmod +x /usr/local/bin/datafusion-cli
38+
39+ # Set datafusion-cli as the entrypoint
40+ ENTRYPOINT ["datafusion-cli" ]
You can’t perform that action at this time.
0 commit comments