From 6d652fc38cf0a75c2b10b54b681d37b6dd8ae7af Mon Sep 17 00:00:00 2001 From: Vivek Date: Sun, 12 Mar 2023 23:36:25 -0700 Subject: [PATCH] optimize arm dockerfile --- Dockerfile.arm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Dockerfile.arm b/Dockerfile.arm index 098bf13..ea849b4 100644 --- a/Dockerfile.arm +++ b/Dockerfile.arm @@ -7,6 +7,10 @@ RUN apk add --no-cache g++ git WORKDIR /usr/src/libreddit +# cache dependencies in their own layer +COPY Cargo.lock Cargo.toml . +RUN mkdir src && echo "fn main() {}" > src/main.rs && cargo install --config net.git-fetch-with-cli=true --path . && rm -rf ./src + COPY . . # net.git-fetch-with-cli is specified in order to prevent a potential OOM kill