3 ms·
If you've got plenty of time for the build, you can. Make a two-stage build where the first stage installs Python and pytorch, and the second stage does ten COP
by electroly 2y ago
If you've got plenty of time for the build, you can. Make a two-stage build where the first stage installs Python and pytorch, and the second stage does ten COPYs which each grab 1/10th of the files from the first stage. Now you've got ten evenly sized layers. I've done this for very large images (lots of Python/R/ML crap) and it takes significant extra time during the build but speeds up pulls because layers can be pulled in parallel.
- thangngoc89 2y agoI see your point on the pull speed. Most of my pulls are stuck at waiting for the pytorch/dependencies layer. This might work with pip but I absolutely hate pip and using poetry with great success. I will investigate how to do this with poetry.