浏览代码

optimize arm dockerfile

Vivek 2 年之前
父节点
当前提交
6d652fc38c
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      Dockerfile.arm

+ 4 - 0
Dockerfile.arm

@@ -7,6 +7,10 @@ RUN apk add --no-cache g++ git
 
 
 WORKDIR /usr/src/libreddit
 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 . .
 COPY . .
 
 
 # net.git-fetch-with-cli is specified in order to prevent a potential OOM kill
 # net.git-fetch-with-cli is specified in order to prevent a potential OOM kill