-
Notifications
You must be signed in to change notification settings - Fork 74k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use shallow git clone in Dockerfiles #4117
Comments
Will that work if we're operating at a specific commit that's not HEAD for our git repos? |
The Dockerfile clones specifies a specific branch at clone time. |
Okay, can you give it a try with and without the shallow-submodules option and show us the time difference? |
Sorry, I should add this has two benefits:
|
|
|
@caisq, could you take a look at integrating this. the devel docker image is pretty insanely huge right now. Somebody nearby filled their disk and wedged their machine installing that docker image :). |
Any thoughts on this? |
On my todo list. Thanks. |
1) Clean up large Bazel build cache. Total filesystem size reduction as seen by du -sh /: devel image: 1.5 GB (Before: 2.9 GB; After: 1.4 GB) devel-gpu image: 2.3 GB (Before: 4.7 GB; After: 2.4 GB) 2) Using nvidia-docker for GPU docker build. 3) Upgrade Bazel version from 0.3.1 to 0.3.2. 4) Add missing libcurl3-dev build dependency to devel images. 5) Add scipy and sklearn to Dockerfile.devel-gpu to enhance consistency with other image types (e.g., Dockerfile.devel). 6) Remove the obsolete and unnecessary --recurse-submodules flag for git clone. Related to GH issues: tensorflow#4116 and tensorflow#4117 However, not using the "git clone --depth 1" suggested by issue tensorflow#4117, because the size of the git repo is only reduced by about 50 MB by the "--depth 1" flag. This space saving is small compared to the space saving due to bazel cache removal. The complete history of the git repo can be useful for certain development purposes. Change: 136302103
We decided not to do shallow git clone, because
Closing this issue. |
1) Clean up large Bazel build cache. Total filesystem size reduction as seen by du -sh /: devel image: 1.5 GB (Before: 2.9 GB; After: 1.4 GB) devel-gpu image: 2.3 GB (Before: 4.7 GB; After: 2.4 GB) 2) Using nvidia-docker for GPU docker build. 3) Upgrade Bazel version from 0.3.1 to 0.3.2. 4) Add missing libcurl3-dev build dependency to devel images. 5) Add scipy and sklearn to Dockerfile.devel-gpu to enhance consistency with other image types (e.g., Dockerfile.devel). 6) Remove the obsolete and unnecessary --recurse-submodules flag for git clone. Related to GH issues: tensorflow#4116 and tensorflow#4117 However, not using the "git clone --depth 1" suggested by issue tensorflow#4117, because the size of the git repo is only reduced by about 50 MB by the "--depth 1" flag. This space saving is small compared to the space saving due to bazel cache removal. The complete history of the git repo can be useful for certain development purposes. Change: 136302103
git clone --depth 1 --shallow-submodules ...
EDIT: Looks like have to omit
--shallow-submodules
for the version of git in the image. This does not seem to affect the size or the speed.The text was updated successfully, but these errors were encountered: