setting --nocache or -c option still builds upon previous image

hello team Balena,

i just want to know if this behaviour is intended:

so initial build, with a buster image, `

[Info]     ┌─────────┬────────────┬─.───────────┐
[Info]     │ Service │ Image Size │ Build Time │
[Info]     ├─────────┼────────────┼────────────┤
[Info]     │ images  │ 539.02 MB  │ 57 seconds │
[Info]     ├─────────┼────────────┼────────────┤
[Info]     │ fbcp    │ 6.72 MB    │ 1 second   │
[Info]     └─────────┴────────────┴────────────┘
[Info]     Build finished in 1 minute, 47 seconds
                            

but then when i update the dockerfile with bookworm, and set nocache on the push, i see

images	
780 MB
4 minutes 50 seconds

fbcp	
7 MB
4 minutes 4 seconds

unfortunately i lost the terminal output for this last build, but this is from the releases page.

i would expect the nocache to not build upon the original but start a new image and disregard the first.

but it looks like this isnt happening.
if this is not the intended case - how can i make sure the remote balena ignored previous images and starts fresh?

kindly,

puc

so then like -
i am trying this again, this time without the --nocache flag,
and no delta?

am I doing something wrong here?
pizeroW is soooo slow already - to constantly have to download 500mb is combersome.

kindly,
puc

Hi there,

Could you share full build logs? Are you using balena build or balena deploy?

From the balenaCLI documentation on the nocache option for building

Don’t use cached layers of previously built images for this project. This ensures that the latest base image and packages are pulled. Note that build logs may still display the message _“Pulling previous images for caching purposes” (as the cloud builder needs previous images to compute delta updates), but the logs will not display the “Using cache” lines for each build step of a Dockerfile.

So even if you see the cached images being downloaded, they should not be used when building the new image.

Regarding deltas. What do you mean that no deltas were generated? Do you mean when creating the release or when the supervisor is pulling the release? Note that even if the delta is not generated on build, the supervisor will try to generate it before pulling the images from the target release.

Let us know if any of this helps