# Adding new applications to /usr/local/bin

**URL:** <https://forums.balena.io/t/adding-new-applications-to-usr-local-bin/5733>\
**Category:** Project help\
**Created:** [March 24, 2019, 11:20pm UTC](https://forums.balena.io/t/adding-new-applications-to-usr-local-bin/5733 "2019-03-24T23:20:26Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![trappswise](https://avatars.discourse-cdn.com/v4/letter/t/bc79bd/32.png) [@trappswise](https://forums.balena.io/u/trappswise)\
**Post date:** [March 24, 2019, 11:20pm UTC](https://forums.balena.io/t/adding-new-applications-to-usr-local-bin/5733/1 "2019-03-24T23:20:26Z")

</div>

I am running a Balena base image: [https://github.com/balena-io-library/base-images/blob/master/balena-base-images/python/raspberrypi3/ubuntu/xenial/3.6.8/build/Dockerfile](https://github.com/balena-io-library/base-images/blob/master/balena-base-images/python/raspberrypi3/ubuntu/xenial/3.6.8/build/Dockerfile), and it works fine, but what I really need is to understand how I could run an executable such as [http://www.aishub.net/ais-dispatcher](http://www.aishub.net/ais-dispatcher).

Each time I added it to the Docker as I would in any other container (as in download it, move it to /usr/local/bin with chmod +x and expect it to be launchable from bash) it reports it does not exist, or cannot be run.

Does anyone have experience on how to accomplish this on balena? I have an inkling that its something super minor I am missing here since it does work on the same Linux distro outside balena. ☹

Similarly, I would expect to run this app with all of its command line parameters using CMD.

This is what I have so far:

```auto
# Download/Unarchive/Move AisHub Dispatcher
RUN wget -O aisdispatcher_linux.tar.gz http://www.aishub.net/downloads/aisdispatcher_arm_glibc.tar.gz \
	&& tar -xzf aisdispatcher_linux.tar.gz && rm aisdispatcher_linux.tar.gz \
	&& mkdir /app \
	&& mv aisdispatcher_arm_glibc/aisdispatcher /app \
	&& chmod +x /app/aisdispatcher

# CMD ["/app/aisdispatcher","-r", "-d", "/dev/ttyS0", "-s", "38400", "-H", "data.aishub.net:2300", "-G"]

```

---

<div class="post-metadata">

**Author:** ![chrisys](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/chrisys/32/1731_2.png) [@chrisys](https://forums.balena.io/u/chrisys)\
**Post date:** [March 25, 2019, 10:52pm UTC](https://forums.balena.io/t/adding-new-applications-to-usr-local-bin/5733/4 "2019-03-25T22:52:18Z")

</div>

Hi @trappswise welcome to the forums!

I’ve just run your app on one of my own devices. It looks like the issue is that you are using invalid double-quote characters in your CMD. You’ll need to use straight/ASCII double quotes, but some of the ones you pasted are typographic ‘66’ ‘99’ style ones.

Here’s the Dockerfile I used which started the app fine:

```
FROM balenalib/raspberrypi3

RUN curl -o aisdispatcher_linux.tar.gz 
http://www.aishub.net/downloads/aisdispatcher_arm_glibc.tar.gz \
&& tar -xzf aisdispatcher_linux.tar.gz && rm aisdispatcher_linux.tar.gz \
&& mkdir /app \
&& mv aisdispatcher_arm_glibc/aisdispatcher /app \
&& chmod +x /app/aisdispatcher

CMD ["/app/aisdispatcher","-r","-d", "/dev/ttyS0", "-s", "38400", "-H", "data.aishub.net:2300", "-G"]

```

I hope this helps!

---

<div class="post-metadata">

**Author:** ![trappswise](https://avatars.discourse-cdn.com/v4/letter/t/bc79bd/32.png) [@trappswise](https://forums.balena.io/u/trappswise)\
**Post date:** [March 28, 2019, 11:31am UTC](https://forums.balena.io/t/adding-new-applications-to-usr-local-bin/5733/5 "2019-03-28T11:31:34Z")

</div>

Thank you for your reply. I have checked, and in the version I posted this was indeed the issue, and it is now resolved. However, we still have a problem such that when we successfully execute CMD command on “/app/aisdispatcher”, which was created in the previous layer, it claims that: " No such file or directory". Do we need to take some extra steps to have the file persist between the CMD command and the commands above it?

---

<div class="post-metadata">

**Author:** ![chrisys](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/chrisys/32/1731_2.png) [@chrisys](https://forums.balena.io/u/chrisys)\
**Post date:** [March 29, 2019, 7:38pm UTC](https://forums.balena.io/t/adding-new-applications-to-usr-local-bin/5733/6 "2019-03-29T19:38:11Z")

</div>

@trappswise did you try the Dockerfile that I posted above? This one starts the app fine.

---

<div class="post-metadata">

**Author:** ![chrisys](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/chrisys/32/1731_2.png) [@chrisys](https://forums.balena.io/u/chrisys)\
**Post date:** [April 1, 2019, 7:58pm UTC](https://forums.balena.io/t/adding-new-applications-to-usr-local-bin/5733/7 "2019-04-01T19:58:29Z")

</div>

@trappswise did you resolve your issue here? If you need any further help let us know in this thread; my colleague shared an email of yours with me but I am not sure if you’ve got past that issue yet.

---

<div class="post-metadata">

**Author:** ![trappswise](https://avatars.discourse-cdn.com/v4/letter/t/bc79bd/32.png) [@trappswise](https://forums.balena.io/u/trappswise)\
**Post date:** [April 10, 2019, 1:28am UTC](https://forums.balena.io/t/adding-new-applications-to-usr-local-bin/5733/8 "2019-04-10T01:28:18Z")

</div>

Yes. The problem was indeed solved! Thank you!
