-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
31 lines (22 loc) · 836 Bytes
/
Dockerfile
File metadata and controls
31 lines (22 loc) · 836 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
# Build stage
FROM rust:1.93-alpine AS builder
# Install musl and OpenSSL development headers
RUN apk add musl-dev openssl-dev
WORKDIR /appli/aws/s3_largecopy
# Copy and build dependencies first for better caching
COPY Cargo.toml ./
RUN mkdir -p src && echo "fn main() {}" > src/main.rs
RUN cargo build --release --target x86_64-unknown-linux-musl
# Copy source and build
COPY src/ ./src/
RUN cargo build --release --target x86_64-unknown-linux-musl
# Final stage - minimal image
FROM alpine:latest
# Install ca-certificates for HTTPS
RUN apk --no-cache add ca-certificates
# Copy the binary
COPY --from=builder /appli/aws/s3_largecopy/target/x86_64-unknown-linux-musl/release/s3_largecopy /usr/local/bin/
# Make it executable
RUN chmod +x /usr/local/bin/s3_largecopy
# Run the binary
ENTRYPOINT ["/usr/local/bin/s3_largecopy"]