Build on Raspberry Pi an deploy

if i push something in localmode to my raspi everything works fine, if i build with qemu i have issues with gtk.
My idea is, to build on the Raspi and push that build to the registry. How can i do that.
Thanks for your help

Hey @henrikw, just in case you weren’t aware, we have dedicated ARM builders available when using balena push from the command line. So QEMU would not be used and the resulting images would be deployed to the registry.

Does your app contain a single image or multiple services? If you have a spare ARM device around I would suggest installing the balena CLI there to perform balena build and balena deploy.

Thank you for your quick response. Im using openbalena…
My app contains multiple Containers. So i cant just use an localmode device for building?
You mean that I should install balena-cli on a raspberry pi? That would be possible!

Of course, I missed the forum topic and should have noticed you are using openBalena. My mistake!

We don’t currently have a way to deploy images that are built on the device, as that would require copying the images back to the local workstation docker daemon before loading and deploying them to the cloud of choice. Normally QEMU would work well in these cases but it’s not unheard of for QEMU to present issues compiling certain applications.

You could do this manually of course but it gets very messy, especially with multiple containers:

  1. build in local mode
  2. SSH into the device
  3. for each image, run balena save <image> -o service1
  4. SCP each image to your workstation
  5. docker load each image and tag with <projectname>_<servicename> where project name is the directory with your compose file
  6. cd into the directory with your compose file and run balena deploy

If the above steps are followed and the images are tagged correctly, balena deploy should find the existing images and happily deploy them. I didn’t recommend this at first as it’s quite a lot of manual steps for each build.

If you have a Raspberry Pi with Node.js you should be able to install the CLI via the NPM method. I’ve also seen users install the CLI in containers if that was something you wanted to try, but it would also require Docker-in-Docker for build/deploy.

I’ll make a note to bring this up internally as a possible feature request.

Okey great then i will try it by installing balena-cli on Raspberry Pi!

Yeah i think it would be a great feature for easy building!

Thanks a lot!!

Hey @henrikw, my colleague suggested something I completely forgot about that would really streamline your workflow.

It is detailed in this GitHub comment here:

To summarize, by running a development image of balenaOS on your ARM device in local mode, the engine socket is exposed over TCP on port 2375. Then you can run balena deploy myApp -h -p 2375 --build where is your Raspberry Pi. This will build the images using your Raspberry Pi and push them to your openBalena instance.

Hope this helps!

1 Like

OH great, thats a good way too. But no Problem, that I installed a PI for Building, because it runs much faster, than building via the:

You Guys are doing a great Job!
Thanks a lot! :blush: