Skip to content

Commit

Permalink
Move apt-get to top of Dockerfile for better caching
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobwgillespie committed Aug 23, 2023
1 parent 91a1caa commit 6eb1d62
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
FROM rust:1.68-bullseye as build

# had to add this for open-ssl
RUN apt-get update -y && \
apt-get install -y pkg-config make g++ libssl-dev ca-certificates && \
rustup target add x86_64-unknown-linux-gnu

RUN USER=root cargo new --bin motorhead
WORKDIR /motorhead

COPY ./Cargo.lock ./Cargo.lock
COPY ./Cargo.toml ./Cargo.toml

# had to add this for open-ssl
RUN apt-get update -y && \
apt-get install -y pkg-config make g++ libssl-dev ca-certificates && \
rustup target add x86_64-unknown-linux-gnu

# cache dependencies
ENV CARGO_NET_GIT_FETCH_WITH_CLI=true
RUN cargo build --release
Expand Down

0 comments on commit 6eb1d62

Please sign in to comment.