# Optimizing release build

**URL:** <https://forums.balena.io/t/optimizing-release-build/225024>\
**Category:** Product support\
**Tags:** builder\
**Created:** [December 18, 2020, 3:08pm UTC](https://forums.balena.io/t/optimizing-release-build/225024 "2020-12-18T15:08:29Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mathroc](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/mathroc/32/5033_2.png) [@mathroc](https://forums.balena.io/u/mathroc)\
**Post date:** [December 18, 2020, 3:08pm UTC](https://forums.balena.io/t/optimizing-release-build/225024/1 "2020-12-18T15:08:29Z")

</div>

Hi,

I’m trying to improve build time when deploying new images. My first step was to prebuild all images and then juste used tagged images in docker-compose.yaml. That way, I expect that if I update only one image, only this one should be transfered to the balena cloud servers and to the devices. I discussed this [here](https://forums.balena.io/t/deploying-an-app-times-out-most-of-the-time/218119/16) and that I was expecting faster build time and was encouraged to do so, so here it goes

However it looks like even with the exact same images, `balena push` still have to upload the whole images to Balena Cloud. Is this normal ? I was expecting not to have to do this because it feels similar to pushing to a docker registry and docker can avoid pushing an image if its already present on the registry. I suppose the images I’m pushing are already stored on Balena Cloud since Balena Cloud is able to push those images to the devices. I don’t know how Balena Cloud work internaly but I think there’s room for improvement here

Then, Balana Cloud build the release. This too takes longer than I expected when I’m pushing the same images the result should already be found in cache / storage and not rebuild.

This is probably related to how Balena Cloud store the releases, I can only make guesses on that. I’m willing to experiment, test and answer any questions you have on that subject

thank you! I would really love to help improve performance both for a convenience point of view and to lower resource usage globaly

---

<div class="post-metadata">

**Author:** ![sradevski](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/sradevski/32/1609_2.png) [@sradevski](https://forums.balena.io/u/sradevski)\
**Post date:** [December 18, 2020, 4:27pm UTC](https://forums.balena.io/t/optimizing-release-build/225024/4 "2020-12-18T16:27:00Z")

</div>

Hey Mathieu, did you have a look at [https://www.balena.io/docs/reference/balena-cli/#deploy-appname-image](https://www.balena.io/docs/reference/balena-cli/#deploy-appname-image)? If you images are pre-built you can use `balena deploy` instead, which should improve the situation. When you do `balena push` it pushes everything to the builder, and then we see if there is a cache we can use for your build (which might not always be the case), but you should see in the build logs whether the cache was used or not.

---

<div class="post-metadata">

**Author:** ![mathroc](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/mathroc/32/5033_2.png) [@mathroc](https://forums.balena.io/u/mathroc)\
**Post date:** [December 18, 2020, 9:19pm UTC](https://forums.balena.io/t/optimizing-release-build/225024/6 "2020-12-18T21:19:28Z")

</div>

indeed @sradevski it’s much better with `balena deploy`, I did not notice that `balena push` forced to upload everything again. I’m down to 1 and a half minute that’s not perfect but it’s very good !

---

<div class="post-metadata">

**Author:** ![dtischler](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/dtischler/32/2483_2.png) [@dtischler](https://forums.balena.io/u/dtischler)\
**Post date:** [December 18, 2020, 10:24pm UTC](https://forums.balena.io/t/optimizing-release-build/225024/7 "2020-12-18T22:24:17Z")

</div>

Great news, glad to hear that!
