Download an Image from the BalenaCloud Registry

Hi everyone!

Is there an easy way to manually pull a container image from the BalenaCloud Registry to my computer once it has been put there by the cloud builder after a balena push? We would like to store some of the images on our private docker hub repository as well, next to deploying them on the devices. We already tried building it locally with the emulated flag to get the image but are not really happy with the time it takes to create it.

Thank you

Hey @msp welcome to the forums!

We don’t currently have an easy way to do this, but I’m interested to hear what your reasoning is - there might be a different way to achieve the same thing or perhaps a simple product change we can make if we can understand the full use case.

My immediate thought was that if you have or need images in your private docker hub registry, that you could use that as the primary source for distributing the images to your devices so that you’re not duplicating things. It is possible to create releases using images from a private Docker registry, see here: Develop locally - Balena Documentation

I’m not necessarily sure that it fits here, but I wonder if you have also looked at buildx for creating multi-architecture images, I personally find this to be a pretty simple way of building images locally which can then be pushed to Docker. This is actually the process we currently use for a lot of our balena blocks - see here for an example: dashboard/ at master · balenablocks/dashboard · GitHub

I hope this helps; by all means come back to us if not!

Hi @chrisys

Thanks for your response. We are trying to achieve the following:

  • We use Balena to deploy our software to our internal test fleet. The biggest benefit next to the fleet management here for us is that Balena’s cloud builder brings down the time to build the image from hours to minutes compared to building it locally, so we would not like to miss that.
  • Once we have tested the software on our fleet we want to hand it over to another company who manages their fleet over their own Balena account. They are running our software as part of a multi container setup. We would like to avoid handing them out our Dockerfile because it relies on build-time secrets to private source repositories. Instead we would like to have them pull only our Docker image from our private Docker Hub repository.

Is there any way Balena supports such a situation or do you see a better workflow in general? The best workaround we found so far was to log in to the Host OS of one of our test devices and use Balena Engine to push the image from there to our private Docker Hub repository.

Thanks for the extra information here! I think I understand the predicament now, but I also think that means, for the moment at least, you’re probably doing things as best as you can. We have been having a lot of internal discussions about how we can productise more components of the balenaCloud stack. The builders are a great example of this; as you’ve witnessed, they can be considerably faster than emulated builds, so why not allow people to utilise this and ship the resultant artifacts to other registries? Not that this is a feature that you’re likely to see on the dashboard any time soon, but just wanted to let you know that this is the approach we’re trying to take.

Maybe if @dfunckt has a free moment sometime he might have some other ideas for your workflow that I didn’t think of.

I can imagine an odd situation where the built image is bad and the only way to track this is to look into the image. Might be useful to have allow having it pulled and run locally.