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

**URL:** <https://forums.balena.io/t/setting-nocache-or-c-option-still-builds-upon-previous-image/369884>\
**Category:** Product support\
**Created:** [February 6, 2024, 6:43pm UTC](https://forums.balena.io/t/setting-nocache-or-c-option-still-builds-upon-previous-image/369884 "2024-02-06T18:43:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![puccaso](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/puccaso/32/8453_2.png) [@puccaso](https://forums.balena.io/u/puccaso)\
**Post date:** [February 6, 2024, 6:43pm UTC](https://forums.balena.io/t/setting-nocache-or-c-option-still-builds-upon-previous-image/369884/1 "2024-02-06T18:43:55Z")

</div>

hello team Balena,

i just want to know if this behaviour is intended:

so initial build, with a buster image, `

```auto
[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

```auto
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

---

<div class="post-metadata">

**Author:** ![puccaso](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/puccaso/32/8453_2.png) [@puccaso](https://forums.balena.io/u/puccaso)\
**Post date:** [February 6, 2024, 7:57pm UTC](https://forums.balena.io/t/setting-nocache-or-c-option-still-builds-upon-previous-image/369884/2 "2024-02-06T19:57:09Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![pipex](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/pipex/32/4840_2.png) [@pipex](https://forums.balena.io/u/pipex)\
**Post date:** [February 6, 2024, 8:49pm UTC](https://forums.balena.io/t/setting-nocache-or-c-option-still-builds-upon-previous-image/369884/3 "2024-02-06T20:49:36Z")

</div>

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](https://docs.balena.io/reference/balena-cli/#-c---nocache)

> 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
