I added a few improvements to the docker files, which result in much smaller images.
Here a comparison:
REPOSITORY TAG IMAGE ID CREATED SIZE
wl-new 0.4.1-cpu 206a09e7f64e 3 hours ago 3.34GB
wl-old 0.4.1-cpu 9634667f608b 4 hours ago 9.92GB
REPOSITORY TAG IMAGE ID CREATED SIZE
wl-new 0.4.1-gpu 46bef0dedc60 13 seconds ago 7.2GB
wl-old 0.4.1-gpu 9d620744a852 3 hours ago 13.4GB
The main tricks:
On the cpu file, install torch-cpu, so that all those unnecessary nvidia-wheels with the shared libs are not installed.
On the gpu file, don't use nvidia base images, because torch will install the libs in the nvidia-wheels anyway and we don't need them twice.
In general, pip install --no-cache-dir will only download and install the packages, but it will not put them into the pip cache, which ends up in the image as well.
I added a few improvements to the docker files, which result in much smaller images.
Here a comparison:
The main tricks:
pip install --no-cache-dir
will only download and install the packages, but it will not put them into the pip cache, which ends up in the image as well.