Better dockerfile
Some checks reported warnings
Rust-build / build (push) Has been cancelled

This commit is contained in:
Justine Pelletreau
2023-07-22 21:23:53 +02:00
parent dc2854faad
commit 75f2ae0655
3 changed files with 120 additions and 190 deletions

View File

@ -1,10 +1,15 @@
FROM rust:slim-buster
FROM rust:slim-buster AS builder
RUN mkdir -p /opt/portnut
COPY --chown=root --chmod=0755 ./src /opt/portnut/src
COPY --chown=root --chmod=0755 ./Cargo.toml /opt/portnut/Cargo.toml
RUN apt update
RUN apt install libssl-dev openssl pkg-config -y
#RUN apt install libssl-dev openssl pkg-config -y
WORKDIR /opt/portnut
RUN cargo build --release
RUN cp target/release/portnut /bin/portnut
CMD ["/bin/portnut"]
FROM debian:stable-slim
WORKDIR /opt/
COPY --from=builder /opt/portnut/target/release/portnut .
ENTRYPOINT ["/opt/portnut"]
CMD [ "" ]