libmedium/Dockerfile

19 lines
607 B
Docker
Raw Normal View History

2022-02-17 20:27:02 +05:30
FROM rust:slim as rust
2021-10-31 22:55:47 +05:30
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
2023-10-20 14:25:51 +05:30
FROM debian:bookworm-slim
2021-10-31 22:55:47 +05:30
RUN useradd -ms /bin/bash -u 1001 libmedium
RUN apt-get update && apt-get install -y ca-certificates
2021-11-02 15:48:18 +05:30
RUN mkdir /var/lib/libmedium && chown libmedium /var/lib/libmedium
2021-10-31 22:55:47 +05:30
COPY --from=rust /src/target/release/libmedium /usr/local/bin/
USER libmedium
ENTRYPOINT ["/usr/local/bin/libmedium"]