little-hesinde/Containerfile

23 lines
437 B
Plaintext
Raw Normal View History

2024-05-10 15:09:07 +00:00
FROM docker.io/rust:1-alpine3.19 AS builder
RUN apk --no-cache add musl-dev
ENV CARGO_CARGO_NEW_VCS="none"
ENV CARGO_BUILD_RUSTFLAGS="-C target-feature=+crt-static"
WORKDIR /work
COPY . .
RUN cargo build --release --target=$(arch)-unknown-linux-musl
RUN cp "./target/$(arch)-unknown-linux-musl/release/rusty-library" /app
FROM scratch
COPY --from=builder /app /app
CMD ["/app", "--", "/library"]
VOLUME ["/library"]
EXPOSE 3000