Files
storage/Dockerfile
lychang a24c63024f init
2024-01-17 00:56:21 +08:00

23 lines
507 B
Docker

FROM rust:1.75 as builder
WORKDIR /app
RUN USER=root cargo new storage
WORKDIR /app/storage
RUN mkdir -p .cargo
COPY config.toml .cargo/
COPY Cargo.toml Cargo.lock ./
COPY ./src src
RUN cargo install --path . --color always
# Copy the app to an base Docker image, here we use distroless
FROM ubuntu:latest
RUN apt-get update
RUN apt-get install -y ca-certificates
RUN update-ca-certificates
RUN mkdir -p /cache
COPY --from=builder /usr/local/cargo/bin/storage /storage
USER 1000
ENTRYPOINT ["/storage"]