-
Notifications
You must be signed in to change notification settings - Fork 382
Description
Proposed change
It would be wonderful to use the Docker buildkit caching capabilities. These enable incremental addition of packages, so one can add a single package to lists like requirements.txt. That invalidates the standard Docker layer caching, but the layer is quickly rebuilt because all the compilation without triggering entire rebuilds. The actual building happens on a special Docker container (which retains the caches).
https://docs.docker.com/develop/develop-images/build_enhancements/
This question includes links to examples for python building (but points out that it doesn't work for R building (which apparently is going to need something like renv to work).
https://stackoverflow.com/questions/59253392/using-docker-buildkit-caching-with-r-packages
Alternative options
I don't know enough to know if repo2docker is already doing something awesome to reuse compilation here. Perhaps a Docker layer per package build? I wonder if that would cause issues, though.
Who would use this feature?
Anyone adding a package would benefit from much quicker rebuilds. Should also help with builds in a place like mybinder.
How much effort will adding it take?
I haven't yet looked at the repo2docker build code, so I don't know. Mea Culpa. Biggest issue is that this requires fairly recent Docker and changes the build process so that builds happen in a Docker container rather than on the host.
Who can do this work?
I could help test, but have not yet dived into the repo2docker code.