Skip to content

Commit

Permalink
dockerfile: cache rust dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
kr4xkan committed Dec 27, 2021
1 parent 0127103 commit 083e7ba
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,14 @@ WORKDIR $BUILD_ROOT
# Installing openssl headers and pkg-config (required openssl-sys and backtrace-sys crates)
RUN apt-get -q update && apt-get install -y libssl-dev pkg-config

COPY src src/
# Caching dependencies
COPY Cargo.toml .
COPY Cargo.lock .
RUN mkdir src \
&& echo "// dummy file" > src/lib.rs \
&& cargo build

COPY src src/

# Building
RUN cargo build
Expand Down

0 comments on commit 083e7ba

Please sign in to comment.