forked from hust-open-atom-club/Robustone
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
46 lines (35 loc) · 1015 Bytes
/
Dockerfile
File metadata and controls
46 lines (35 loc) · 1015 Bytes
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
40
41
42
43
44
45
46
# Multi-stage build for Robustone CLI
FROM rust:1.75-slim as builder
# Install system dependencies
RUN apt-get update && apt-get install -y \
build-essential \
cmake \
python3 \
git \
&& rm -rf /var/lib/apt/lists/*
# Set working directory
WORKDIR /app
# Copy Cargo files
COPY Cargo.toml Cargo.lock ./
COPY robustone-core ./robustone-core/
COPY robustone-cli ./robustone-cli/
COPY robustone ./robustone/
# Build the application
RUN cargo build --release
# Runtime stage
FROM debian:bookworm-slim
# Install runtime dependencies
RUN apt-get update && apt-get install -y \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
# Create non-root user
RUN useradd -r -s /bin/false robustone
# Copy the binary from builder stage
COPY --from=builder /app/target/release/robustone-cli /usr/local/bin/robustone-cli
# Set ownership
RUN chown robustone:robustone /usr/local/bin/robustone-cli
# Switch to non-root user
USER robustone
# Set entrypoint
ENTRYPOINT ["robustone-cli"]
CMD ["--help"]