mvysny / shepherd

Build & run apps automatically
1 stars 0 forks source link

Build: cache Gradle/Maven folders between builds #3

Open mvysny opened 1 year ago

mvysny commented 1 year ago

Cache the following folders between builds:

mvysny commented 1 year ago

I was thinking bind mount, but that's not available in docker build: https://stackoverflow.com/questions/26050899/how-to-mount-host-volumes-into-docker-containers-in-dockerfile-during-build

However, the Docker BuildKit might contain a solution: https://docs.docker.com/build/buildkit/

mvysny commented 1 year ago

This is also interesting: https://zwbetz.com/reuse-the-gradle-dependency-cache-with-docker/

On closer look, this could be very hard to implement. It requires fiddling with Dockerfile and adding another build stage which builds the "-cached" image; then on next run the Dockerfile needs to be modified to start off this "-cached" image. This could create an endless string of docker images.

Maybe a better way would be to modify Dockerfile and tar the folders to an archive then store it on a private ftp, then untar the folders before build.