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 <rajpratik71@gmail.com>

Pull Request resolved: https://github.com/facebook/infer/pull/1341

Reviewed By: da319

Differential Revision: D24917645

Pulled By: jvillard

fbshipit-source-id: 6764fc971
master
Pratik raj 4 years ago committed by Facebook GitHub Bot
parent 49dc61b9c5
commit 9d49fd5c60

@ -37,7 +37,7 @@ RUN opam init --reinit --bare --disable-sandboxing
# Download the latest Infer master # Download the latest Infer master
RUN cd / && \ 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 # 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 # don't lose the significant amount of work done in the previous

@ -41,7 +41,7 @@ RUN opam init --reinit --bare --disable-sandboxing --yes --auto-setup
# Download the latest Infer master # Download the latest Infer master
RUN cd / && \ 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 # 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 # fails we don't lose the significant amount of work done in the

Loading…
Cancel
Save