Open VincentGuyader opened 10 months ago
it works, but as far as i know if you change your renv.lock.prod fie it's not possible to only rerun final.
Is that a problem? If you change which packages your project uses, you want docker to install those changes, right?
If you have the previous docker image pulled then it should only run subsequent layers from the COPY renv.lock.prod renv.lock
command onwards (not the entire base
stage)
it works, but as far as i know if you change your renv.lock.prod fie it's not possible to only rerun final.
Is that a problem? If you change which packages your project uses, you want docker to install those changes, right?
If you have the previous docker image pulled then it should only run subsequent layers from the
COPY renv.lock.prod renv.lock
command onwards (not the entirebase
stage)
HI, COPY renv.lock.prod renv.lock
is in both stage ... :(
today, the
add_dockerfile_with_renv
fonction create 2 Dockerfile tu be able to reuse the renv cache from the first image, in se second one.like this :
we can set instead an unique Dockerfile with multistage :
it works, but as far as i know if you change your renv.lock.prod fie it's not possible to only rerun final.
I have tried --target, --cache-from .. without succes.
some other people have the same need as us , see in python here :
https://pythonspeed.com/articles/faster-multi-stage-builds/
but the solution is not clean at all.
so I think that we will keed the actual solution, if anyone else wants to try looking, I'd be happy to since I have no experience with docker multistage
https://stackoverflow.com/questions/52697948/artifact-caching-for-multistage-docker-builds