From ddff9bdbfb94ad6814fc9ee815dc87be571d75f3 Mon Sep 17 00:00:00 2001 From: meeg_leeto Date: Fri, 15 Apr 2022 01:24:04 +0100 Subject: [PATCH] wip: still tuning Dockerfile --- Dockerfile | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index d1aca39..9147232 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,19 +1,21 @@ # Prepare container FROM rust:slim-buster RUN USER=root cargo new --bin lonk -WORKDIR lonk +WORKDIR /lonk # Compile dependencies -COPY ./Cargo.lock ./Cargo.lock -COPY ./Cargo.toml ./Cargo.toml +COPY ./Cargo.lock /lonk/Cargo.lock +COPY ./Cargo.toml /lonk/Cargo.toml RUN cargo build -RUN rm src/*.rs +RUN rm /lonk/src/*.rs # Compile the source -COPY ./src ./src +COPY ./src /lonk/src +RUN rm /lonk/target/${PROFILE:-debug}/deps/lonk* RUN cargo build -RUN cp /lonk/target/${PROFILE:-debug}/lonk . +RUN cp /lonk/target/${PROFILE:-debug}/lonk /bin/lonk +WORKDIR /bin CMD ["./lonk"] \ No newline at end of file