-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
25 lines (21 loc) · 803 Bytes
/
Dockerfile
File metadata and controls
25 lines (21 loc) · 803 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
# syntax=docker/dockerfile:1
# Adapted from the multi-stage build example in https://hub.docker.com/_/rust
# Which Cargo profile to use.
ARG PROFILE=release
# Stage 1: builder
FROM rust:1.78 as builder
ARG PROFILE
WORKDIR /build
COPY . .
# NOTE: By default 'cargo install' ignores the Cargo.lock file, and pulls in
# the latest allowed versions. This can result in builds failing, so use the
# --locked argument to use Cargo.lock.
RUN cargo install --path . --profile $PROFILE --locked
# Stage 2: final image
FROM debian:bookworm-slim
# AWS SDK requires CA certificates to be present.
RUN apt update \
&& apt install -y --no-install-recommends ca-certificates \
&& update-ca-certificates
COPY --from=builder /usr/local/cargo/bin/reductionist /usr/local/bin/reductionist
CMD ["reductionist"]