2022-04-14 22:39:40 +00:00
|
|
|
# Prepare container
|
|
|
|
FROM rust:slim-buster
|
2022-04-08 21:29:03 +00:00
|
|
|
RUN USER=root cargo new --bin lonk
|
|
|
|
WORKDIR lonk
|
|
|
|
|
|
|
|
# Compile dependencies
|
|
|
|
|
|
|
|
COPY ./Cargo.lock ./Cargo.lock
|
|
|
|
COPY ./Cargo.toml ./Cargo.toml
|
|
|
|
|
2022-04-14 12:33:32 +00:00
|
|
|
RUN cargo build
|
2022-04-14 17:14:14 +00:00
|
|
|
RUN rm src/*.rs
|
2022-04-08 21:29:03 +00:00
|
|
|
|
|
|
|
# Compile the source
|
|
|
|
COPY ./src ./src
|
|
|
|
RUN cargo build
|
2022-04-14 22:39:40 +00:00
|
|
|
RUN cp /lonk/target/${PROFILE:-debug}/lonk .
|
2022-04-08 21:29:03 +00:00
|
|
|
|
2022-04-14 22:39:40 +00:00
|
|
|
CMD ["./lonk"]
|