# Balena git repo development

**URL:** <https://forums.balena.io/t/balena-git-repo-development/58937>\
**Category:** Project help\
**Created:** [January 24, 2020, 2:07am UTC](https://forums.balena.io/t/balena-git-repo-development/58937 "2020-01-24T02:07:37Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![lorugant](https://avatars.discourse-cdn.com/v4/letter/l/e36b37/32.png) [@lorugant](https://forums.balena.io/u/lorugant)\
**Post date:** [January 24, 2020, 2:07am UTC](https://forums.balena.io/t/balena-git-repo-development/58937/1 "2020-01-24T02:07:37Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![AlexProgrammerDE](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/alexprogrammerde/32/3040_2.png) [@AlexProgrammerDE](https://forums.balena.io/u/AlexProgrammerDE)\
**Post date:** [January 24, 2020, 6:39am UTC](https://forums.balena.io/t/balena-git-repo-development/58937/2 "2020-01-24T06:39:12Z")

</div>

@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](https://www.balena.io/docs/learn/develop/multicontainer/#labels)

---

<div class="post-metadata">

**Author:** ![afitzek](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/afitzek/32/359_2.png) [@afitzek](https://forums.balena.io/u/afitzek)\
**Post date:** [January 24, 2020, 10:14am UTC](https://forums.balena.io/t/balena-git-repo-development/58937/3 "2020-01-24T10:14:19Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![lorugant](https://avatars.discourse-cdn.com/v4/letter/l/e36b37/32.png) [@lorugant](https://forums.balena.io/u/lorugant)\
**Post date:** [January 24, 2020, 2:33pm UTC](https://forums.balena.io/t/balena-git-repo-development/58937/5 "2020-01-24T14:33:45Z")

</div>

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,

> **[Jetson Nano - Run on USB Drive - JetsonHacks](https://www.jetsonhacks.com/2019/04/25/jetson-nano-run-on-usb-drive/)**
>
> A USB Drive makes the NVIDIA Jetson Nano Developer Kit much more fun to use. Here we install a SSD, and run the Nano from there!

---

<div class="post-metadata">

**Author:** ![AlexProgrammerDE](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/alexprogrammerde/32/3040_2.png) [@AlexProgrammerDE](https://forums.balena.io/u/AlexProgrammerDE)\
**Post date:** [January 24, 2020, 3:31pm UTC](https://forums.balena.io/t/balena-git-repo-development/58937/6 "2020-01-24T15:31:07Z")

</div>

@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](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/](https://docs.docker.com/compose/)  
And for balena here: [https://www.balena.io/docs/learn/develop/multicontainer/](https://www.balena.io/docs/learn/develop/multicontainer/)

---

<div class="post-metadata">

**Author:** ![alanb128](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/alanb128/32/2839_2.png) [@alanb128](https://forums.balena.io/u/alanb128)\
**Post date:** [January 24, 2020, 5:08pm UTC](https://forums.balena.io/t/balena-git-repo-development/58937/8 "2020-01-24T17:08:00Z")

</div>

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/](https://www.balena.io/blog/multi-stage-docker-builds-for-tiny-iot-images/)

---

<div class="post-metadata">

**Author:** ![lorugant](https://avatars.discourse-cdn.com/v4/letter/l/e36b37/32.png) [@lorugant](https://forums.balena.io/u/lorugant)\
**Post date:** [January 24, 2020, 6:00pm UTC](https://forums.balena.io/t/balena-git-repo-development/58937/10 "2020-01-24T18:00:18Z")

</div>

Ok got it. Thank you!

---

<div class="post-metadata">

**Author:** ![lorugant](https://avatars.discourse-cdn.com/v4/letter/l/e36b37/32.png) [@lorugant](https://forums.balena.io/u/lorugant)\
**Post date:** [January 24, 2020, 6:00pm UTC](https://forums.balena.io/t/balena-git-repo-development/58937/11 "2020-01-24T18:00:57Z")

</div>

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