-
-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathDockerfile
More file actions
18 lines (17 loc) · 607 Bytes
/
Copy pathDockerfile
File metadata and controls
18 lines (17 loc) · 607 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
FROM rust:slim as rust
WORKDIR /src
RUN apt-get update && apt-get install -y git pkg-config libssl-dev
RUN mkdir src && echo "fn main() {}" > src/main.rs
COPY Cargo.toml .
RUN sed -i '/.*build.rs.*/d' Cargo.toml
COPY Cargo.lock .
RUN cargo build --release
COPY . /src
RUN cargo build --release
FROM debian:bookworm-slim
RUN useradd -ms /bin/bash -u 1001 libmedium
RUN apt-get update && apt-get install -y ca-certificates
RUN mkdir /var/lib/libmedium && chown libmedium /var/lib/libmedium
COPY --from=rust /src/target/release/libmedium /usr/local/bin/
USER libmedium
ENTRYPOINT ["/usr/local/bin/libmedium"]