lonk/Dockerfile

21 lines
414 B
Docker
Raw Normal View History

# Prepare container
FROM rust:slim-buster
RUN USER=root cargo new --bin lonk
2022-04-15 00:24:04 +00:00
WORKDIR /lonk
# Compile dependencies
2022-04-15 00:24:04 +00:00
COPY ./Cargo.lock /lonk/Cargo.lock
COPY ./Cargo.toml /lonk/Cargo.toml
RUN cargo build
2022-04-15 00:24:04 +00:00
RUN rm /lonk/src/*.rs
# Compile the source
2022-04-15 00:24:04 +00:00
COPY ./src /lonk/src
RUN rm /lonk/target/${PROFILE:-debug}/deps/lonk*
RUN cargo build
2022-04-15 00:24:04 +00:00
RUN cp /lonk/target/${PROFILE:-debug}/lonk /bin/lonk
2022-04-15 00:24:04 +00:00
WORKDIR /bin
CMD ["./lonk"]