Balena git repo development

Hi,

So I am currently having a developmental branch of git repo in balena in local mode itself. So I am trying to edit code, compile and test it on the device locally before deploying. The problem is, when I am trying to compile, the compiler on balena is not taking my changes and compiling new code. Also in local mode, I am having hard time running sudo balena scan. If I use just balena scan, it says it needs supervisory privileges and if I run it with sudo , it says sudo: balena: command not found. Please help! Any input is appreciated, Thank you!

@lorugant i can maybe help you with balena scan. Sudo is not working in balena. You have to give your container the supervisor label. Here is a link to how it works: https://www.balena.io/docs/learn/develop/multicontainer/#labels

Hi @lorugant,

I suspect you have a code repo on your laptop (or workstation), and you try to push the changes to a balena device in your local network via local mode?

Can you show us the commands you are using to push the code to the balena device?

The only command you should need is: balena push <IP> where <IP> is the local IP of your device, which you can find in the dashboard. The device has to be in local mode and a development OS image.

Thank you for responding to my issues so quickly.

@AlexProgrammerDE can I give the supervisory label as an environment label or something? because I am not using docker-compose file. I am just using a docker file to build my images. Also, is there a way to know what state my program is in when I am in the local mode?

@afitzek yes. you are right. So instead of IP, I am giving command in the following structure
balena push app-name

and yes it is in development and local mode

PS: I am working on Jetson nano and my dockerfile generated image is quite large. Even using 256GB sdcard and with Jetson nano original image, I couldn’t run my container solely with sdcard (as in compiling my programs inside container and all), I followed jetson hacks and ran root file system through ssd and I was able to build my programs inside docker container. Is it possible for me to change something inorder to change rootfile system to run from ssd or hdd instead of the sdcard alone using balena?
The link which I am talking about is here,

@lorugant i highly recommend using a docker compose. I you don´t know how to use one i can explain it to you. You can simply add the compose file in the root of the directory. The files should stay where they are.
You can see as an example this file: https://github.com/AlexProgrammerDE/balena-minecraft-server/blob/master/docker-compose.yml

You can read more about compose files here: https://docs.docker.com/compose/
And for balena here: https://www.balena.io/docs/learn/develop/multicontainer/

Hello @lorugant, booting from an SSD/HDD per the link you supplied is not something we support. I suggest looking into multi-stage builds to reduce your build size and copy only the necessary installed libraries and packages to the final container image: https://www.balena.io/blog/multi-stage-docker-builds-for-tiny-iot-images/

Ok got it. Thank you!

@AlexProgrammerDE yes, I will follow the docker-compose tutorial and will include in my project.Thanks!