Reducing size of docker Linux image (#41207)
Summary:
# Description
The goal is to reduce the size of the docker image. I checked a few things:
* Docker layer overlaps
* Removing .git folder
* Removing intermediate build artifacts (*.o and *.a)
The only one that gave satisfying result was the 3rd approach, removing *.o and *.a. The final image went from 10 GB to 9.7 GB.
I used Dive (https://github.com/wagoodman/dive) to inspect the Docker image manually.
# Test:
* Check the image size was reduced
* No test failures in CI
Pull Request resolved: https://github.com/pytorch/pytorch/pull/41207
Test Plan:
* Check the image size was reduced
* No test failures in CI
Differential Revision: D22465221
Pulled By: ssylvain
fbshipit-source-id: 48754259729401e3c08447b0fa0630ca7217cb98