From 9d49fd5c60c6bd065e3b8257d4e59e3eddc327a0 Mon Sep 17 00:00:00 2001 From: Pratik raj Date: Fri, 13 Nov 2020 06:24:23 -0800 Subject: [PATCH] Use `--depth` flag to `git clone` in Dockerfiles, to save space (#1341) Summary: optimize the git clone using --depth flag in term of size of clone and also in term's of time taken to fetch the files and commit history of whole repository . More detail can be found at blog https://www.atlassian.com/git/tutorials/big-repositories Signed-off-by: Pratik Raj Pull Request resolved: https://github.com/facebook/infer/pull/1341 Reviewed By: da319 Differential Revision: D24917645 Pulled By: jvillard fbshipit-source-id: 6764fc971 --- docker/master-java/Dockerfile | 2 +- docker/master/Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docker/master-java/Dockerfile b/docker/master-java/Dockerfile index fdad58ddf..f0792449a 100644 --- a/docker/master-java/Dockerfile +++ b/docker/master-java/Dockerfile @@ -37,7 +37,7 @@ RUN opam init --reinit --bare --disable-sandboxing # Download the latest Infer master RUN cd / && \ - git clone https://github.com/facebook/infer/ + git clone --depth 1 https://github.com/facebook/infer/ # Build opam deps first, then infer. This way if any step fails we # don't lose the significant amount of work done in the previous diff --git a/docker/master/Dockerfile b/docker/master/Dockerfile index b441e2782..ce879afff 100644 --- a/docker/master/Dockerfile +++ b/docker/master/Dockerfile @@ -41,7 +41,7 @@ RUN opam init --reinit --bare --disable-sandboxing --yes --auto-setup # Download the latest Infer master RUN cd / && \ - git clone --recurse-submodules https://github.com/facebook/infer/ + git clone --depth 1 --recurse-submodules https://github.com/facebook/infer/ # Build opam deps first, then clang, then infer. This way if any step # fails we don't lose the significant amount of work done in the