# Dockerfile.\<stuff\>

**URL:** <https://forums.balena.io/t/dockerfile-stuff/95387>\
**Category:** Product support\
**Created:** [April 19, 2020, 5:36pm UTC](https://forums.balena.io/t/dockerfile-stuff/95387 "2020-04-19T17:36:58Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![tdesaules](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/tdesaules/32/3448_2.png) [@tdesaules](https://forums.balena.io/u/tdesaules)\
**Post date:** [April 19, 2020, 5:36pm UTC](https://forums.balena.io/t/dockerfile-stuff/95387/1 "2020-04-19T17:36:58Z")

</div>

Hi guys !

I try to clean my Dockerfile.

The classic “Dockerfile” work fine and the Dockerfile.template also.

When I try something like Dockerfile.armv7hf or aarch64 I have an error on the balena bush that it can’t find my Dockerfile.

Any idea ?

---

<div class="post-metadata">

**Author:** ![osde8info](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/osde8info/32/3319_2.png) [@osde8info](https://forums.balena.io/u/osde8info)\
**Post date:** [April 19, 2020, 9:26pm UTC](https://forums.balena.io/t/dockerfile-stuff/95387/2 "2020-04-19T21:26:13Z")

</div>

what devices did you say were going to be in your APP ?

balena push can only push to the same type of devices that you have defined in your APP

maybe you have a mismatch

---

<div class="post-metadata">

**Author:** ![tdesaules](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/tdesaules/32/3448_2.png) [@tdesaules](https://forums.balena.io/u/tdesaules)\
**Post date:** [April 20, 2020, 7:17am UTC](https://forums.balena.io/t/dockerfile-stuff/95387/3 "2020-04-20T07:17:49Z")

</div>

Hi,

The application is set to “rpi” and I have a “Raspberry Pi 2” and a “Raspberry Pi 3”.

I try dockerfile like : Dockerfile.armv7hf or Dockerfile.raspberry-pi2 and Dockerfile.raspberrypi3 without success.

Dockerfile and Dockerfile.template work fine.

At this time I use the Dockerfile.template with the balenalib docker hub alpine image :

```auto
FROM balenalib/%%BALENA_ARCH%%-alpine:latest

```

Don’t know the difference between the official alpine image and the balena one

---

<div class="post-metadata">

**Author:** ![nghiant2710](https://avatars.discourse-cdn.com/v4/letter/n/90db22/32.png) [@nghiant2710](https://forums.balena.io/u/nghiant2710)\
**Post date:** [April 20, 2020, 8:21am UTC](https://forums.balena.io/t/dockerfile-stuff/95387/4 "2020-04-20T08:21:24Z")

</div>

Hi,

You can find more details about using multiple dockerfiles in our docs here [https://www.balena.io/docs/learn/develop/dockerfile/#multiple-dockerfiles](https://www.balena.io/docs/learn/develop/dockerfile/#multiple-dockerfiles), basically if the `device-type` of your application is `raspberry-pi2` then `Dockerfile.raspberry-pi2` will be selected, otherwise `Dockerfile.armv7hf` or `Dockerfile.template` or `Dockerfile` will be selected. In your case, the application is set to `rpi` then `Dockerfile.rpi` will be selected but you don’t have that file available so it didn’t work.

---

<div class="post-metadata">

**Author:** ![nghiant2710](https://avatars.discourse-cdn.com/v4/letter/n/90db22/32.png) [@nghiant2710](https://forums.balena.io/u/nghiant2710)\
**Post date:** [April 20, 2020, 8:23am UTC](https://forums.balena.io/t/dockerfile-stuff/95387/5 "2020-04-20T08:23:39Z")

</div>

Regarding your second question, in the `balenalib` base images, we pre-installed some packages and tools so they will provide some extra features in comparison with official base images, more details can be found in our base images docs [https://www.balena.io/docs/reference/base-images/base-images/#balena-base-images](https://www.balena.io/docs/reference/base-images/base-images/#balena-base-images)

---

<div class="post-metadata">

**Author:** ![tdesaules](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/tdesaules/32/3448_2.png) [@tdesaules](https://forums.balena.io/u/tdesaules)\
**Post date:** [April 20, 2020, 10:47am UTC](https://forums.balena.io/t/dockerfile-stuff/95387/7 "2020-04-20T10:47:02Z")

</div>

Hi,

I need to have a Dockerfile.rpi ? If I have rpi2, rpi3, rpi4 how to address different Dockerfile for those device ? It is what I try to do first : Dockerfile.armv7hf + Dockerfile.aarch64 and it doesn’t work

---

<div class="post-metadata">

**Author:** ![georgiats](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/georgiats/32/2571_2.png) [@georgiats](https://forums.balena.io/u/georgiats)\
**Post date:** [April 20, 2020, 1:35pm UTC](https://forums.balena.io/t/dockerfile-stuff/95387/8 "2020-04-20T13:35:19Z")

</div>

Hello!  
could you please send some extra information so that we can assist you better?

1. You’ve mentioned that if you try to Balena push then you get an error. Could you please send us the error message and any related logs?
2. Could you let us know more about the application those devices are connected, what kind of device type is this application targeted for?

Thanks!

---

<div class="post-metadata">

**Author:** ![tdesaules](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/tdesaules/32/3448_2.png) [@tdesaules](https://forums.balena.io/u/tdesaules)\
**Post date:** [April 22, 2020, 7:41am UTC](https://forums.balena.io/t/dockerfile-stuff/95387/10 "2020-04-22T07:41:57Z")

</div>

Hi,

Sorry, no time to test, I’m using the Dockerfile.template with balena apline image.

I’m working on a mopidy image with jellyfin client/server to add local music capabilities to my balena-sound.

I have have Raspberry Pi 2 / Raspberry Pi 3. the target will be Raspberry Pi 4 and Raspberry Pi 3 A+

I need to finish other stuff and I will try again the Dockerfile.armv7hf and Dockerfile.aarch64

Thank you

---

<div class="post-metadata">

**Author:** ![georgiats](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/georgiats/32/2571_2.png) [@georgiats](https://forums.balena.io/u/georgiats)\
**Post date:** [April 22, 2020, 12:04pm UTC](https://forums.balena.io/t/dockerfile-stuff/95387/13 "2020-04-22T12:04:40Z")

</div>

Hi there!  
As mentioned above in your case, the application is set to rpi then Dockerfile.rpi will be selected but you don’t have that file available so it didn’t work. Make sure you create a new application type before you try again.  
Please let us know when you test this and how it works for you.

---

<div class="post-metadata">

**Author:** ![tdesaules](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/tdesaules/32/3448_2.png) [@tdesaules](https://forums.balena.io/u/tdesaules)\
**Post date:** [April 22, 2020, 1:51pm UTC](https://forums.balena.io/t/dockerfile-stuff/95387/15 "2020-04-22T13:51:19Z")

</div>

Well what I was trying to do is to create a different docker file regarding my rpi2 / rpi3 / rpi4 on a same app. ( more related to the archetecture )

So I need to have a Dockerfile.rpi, Dockerfile.armv7hf and Dockerfile.aarch64 ?

---

<div class="post-metadata">

**Author:** ![majorz](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/majorz/32/639_2.png) [@majorz](https://forums.balena.io/u/majorz)\
**Post date:** [April 22, 2020, 2:19pm UTC](https://forums.balena.io/t/dockerfile-stuff/95387/16 "2020-04-22T14:19:29Z")

</div>

Yes, here is an example with that: [https://github.com/balena-io-examples/multicontainer-getting-started/tree/master/haproxy](https://github.com/balena-io-examples/multicontainer-getting-started/tree/master/haproxy)

---

<div class="post-metadata">

**Author:** ![majorz](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/majorz/32/639_2.png) [@majorz](https://forums.balena.io/u/majorz)\
**Post date:** [April 22, 2020, 2:28pm UTC](https://forums.balena.io/t/dockerfile-stuff/95387/17 "2020-04-22T14:28:37Z")

</div>

You still need to make a separate balena application for RPi 2, RPi 3 and RPi 4, but at least you can use the same folder from which to push your sources to our builders.

---

<div class="post-metadata">

**Author:** ![tdesaules](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/tdesaules/32/3448_2.png) [@tdesaules](https://forums.balena.io/u/tdesaules)\
**Post date:** [April 22, 2020, 7:33pm UTC](https://forums.balena.io/t/dockerfile-stuff/95387/19 "2020-04-22T19:33:30Z")

</div>

hummm ok make sense !

thank you
