Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple builds which only differ in a later stage to cache erlier stages #796

Open
MexHigh opened this issue Sep 27, 2024 · 2 comments
Open

Comments

@MexHigh
Copy link

MexHigh commented Sep 27, 2024

I've added a stage "stage2a" which adds application specific things to the RPi OS Lite image (created by stage2). I want to create mutiple builds (optimally from a build pipeline) which only differ in the stage2a stage, meaning that everything up to stage2 remains unchanged.

Every stage starting from stage3 has SKIP and SKIP_IMAGE files in it so that the build process stops after stage2a. This works good.

However, when running multiple builds sequencially, stage1 and stage2 are never "cached" and rebuilt, which takes a lot of time. So my question is: Is there a way to cache build stages up to a specific stage to speed up multiple builds?. I'm using the docker build method (./build-docker.sh).


Edit: The instuctions in the README ("Skipping stages to speed up development") does not work for me. What I've tried (the correct stages already have SKIP_IMAGE files):

./build-docker.sh # builds all stages
touch stage1/SKIP
touch stage2/SKIP
PRESERVE_CONTAINER=1 CONTINUE=1 CLEAN=1 ./build-docker.sh

Both ./build-docker.sh calls run all build stages. Am I doing anything wrong?

@pbaetens
Copy link

for each build variant, just create a new stage folder?

@MexHigh
Copy link
Author

MexHigh commented Oct 9, 2024

But wouldn't that mean that a stage n+1 would include all changes made in stage n? I want to make e.g. five images, all with "unique" settings starting from stage 2 (Lite image).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants