square-laptop-33187
03/17/2023, 5:46 PMdocker_image
is an dependency? Meaning that some other targets depend on a docker image. e.g. running tests using that image, building another image using it as a base image, etc.broad-processor-92400
03/17/2023, 8:21 PMsquare-laptop-33187
03/17/2023, 10:08 PMapt-get install
)? I only want to rerun when necessary.
A few options I can think of are
1. Single Dockerfile with separate layer and rely on docker build cache -> difficult to reuse cache in CI/CD and sometimes save/load are still slow when the final image is big.
2. Use pants caching: Two dockerfile, Dockerfile-base
adds some specific tag (e.g. -t apt-installs-latest
) and the next Dockerfile-main
uses it (FROM apt-installs-latest
). Pants dependency could be set so that building Dockerfile-main
depends on Dockerfile-base
. With --change-from
, it could skip building Dockerfile-base
if not changed. -> relying on tag seems brittle
Any thoughts?broad-processor-92400
03/18/2023, 2:23 AMsquare-laptop-33187
03/20/2023, 2:35 PM