-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile.alpine
More file actions
39 lines (30 loc) · 928 Bytes
/
Dockerfile.alpine
File metadata and controls
39 lines (30 loc) · 928 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
# Multi-stage build for SandD daemon - Alpine Linux (musl-based)
# Build with musl target for Alpine compatibility
FROM rust:1.85-alpine as builder
WORKDIR /app
# Install build dependencies for Alpine
RUN apk add --no-cache \
musl-dev \
pkgconfig \
openssl-dev \
openssl-libs-static
# Copy workspace files
COPY Cargo.toml Cargo.lock ./
COPY sandd/ ./sandd/
COPY server/ ./server/
# Build the daemon binary in release mode
# Alpine uses musl libc, which is already the default target
RUN cargo build --package sandd --release
# Runtime stage - Alpine for minimal size
FROM alpine:3.21
# Install runtime dependencies
RUN apk add --no-cache \
ca-certificates \
libgcc
# Copy the binary from builder
COPY --from=builder /app/target/release/sandd /usr/local/bin/sandd
# Set working directory
WORKDIR /workspace
# Default command - can be overridden
ENTRYPOINT ["/usr/local/bin/sandd"]
CMD ["--help"]