wip: still tuning Dockerfile
This commit is contained in:
parent
b53646cb64
commit
ddff9bdbfb
14
Dockerfile
14
Dockerfile
|
@ -1,19 +1,21 @@
|
||||||
# Prepare container
|
# Prepare container
|
||||||
FROM rust:slim-buster
|
FROM rust:slim-buster
|
||||||
RUN USER=root cargo new --bin lonk
|
RUN USER=root cargo new --bin lonk
|
||||||
WORKDIR lonk
|
WORKDIR /lonk
|
||||||
|
|
||||||
# Compile dependencies
|
# Compile dependencies
|
||||||
|
|
||||||
COPY ./Cargo.lock ./Cargo.lock
|
COPY ./Cargo.lock /lonk/Cargo.lock
|
||||||
COPY ./Cargo.toml ./Cargo.toml
|
COPY ./Cargo.toml /lonk/Cargo.toml
|
||||||
|
|
||||||
RUN cargo build
|
RUN cargo build
|
||||||
RUN rm src/*.rs
|
RUN rm /lonk/src/*.rs
|
||||||
|
|
||||||
# Compile the source
|
# Compile the source
|
||||||
COPY ./src ./src
|
COPY ./src /lonk/src
|
||||||
|
RUN rm /lonk/target/${PROFILE:-debug}/deps/lonk*
|
||||||
RUN cargo build
|
RUN cargo build
|
||||||
RUN cp /lonk/target/${PROFILE:-debug}/lonk .
|
RUN cp /lonk/target/${PROFILE:-debug}/lonk /bin/lonk
|
||||||
|
|
||||||
|
WORKDIR /bin
|
||||||
CMD ["./lonk"]
|
CMD ["./lonk"]
|
Loading…
Reference in New Issue