Merge pull request #751 from master-hax/optimize-docker

optimize arm dockerfile
This commit is contained in:
Matthew Esposito 2023-04-07 12:02:03 -04:00 committed by GitHub
commit 62771bf4a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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