wip: still tuning Dockerfile
This commit is contained in:
parent
b53646cb64
commit
ddff9bdbfb
14
Dockerfile
14
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"]
|
Loading…
Reference in New Issue