How to deploy official eclipse-mosquitto container on a raspberry pi as a service in a docker compose file?

I would like to install the official eclipse-mosquitto container on my raspberry pi as a service in a docker compose file.

To do so I have added following lines to my docker-compose.yml

...
  mqtt2:
    image: eclipse-mosquitto
    ports:
      - "1884:1883"
...

but when balena deploys it I am getting following error in the log file:

01.04.19 10:16:39 (+0200)  mqtt2  standard_init_linux.go:195: exec user process caused "exec format error"
01.04.19 10:16:47 (+0200)  mqtt2  standard_init_linux.go:195: exec user process caused "exec format error"
01.04.19 10:16:52 (+0200)  mqtt2  standard_init_linux.go:195: exec user process caused "exec format error"

This most likely means that balena has installed an image for a different hardware architecture (so not compatible for my raspberry pi 3B).

Note that according to the eclipse-mosquitto documentation it is supported on ARM and ARM64 architecture

So how I can fix this problem ?

jan.

1 Like

I have found the fix.

On the docker hub link: eclipse-mosquitto
you can find a section Supported architectures with following content:

Supported architectures : (more info)
amd64 , arm32v6 , arm64v8 , i386 , ppc64le , s390x

For Raspberry Pi 3B you need to select arm32v7 or arm32v6 in case v7 is not available and this will navigate you to arm32v6/eclipse-mosquitto
which will tell you to use arm32v6/eclipse-mosquitto as image.

So the following commands in the docker-compose.yml should work for a raspberry Pi 3B.

  mqtt:
    image: arm32v6/eclipse-mosquitto
    ports:
      - "1883:1883"
1 Like

@janvda Glad you found the solution. Unfortunately our builder doesn’t (yet) understand the docker manifests, so when you use the official images, it pulls the default x86 architecture base image rather than the ARM one that the rpi needs. We hope to support this eventually, but for now you need to explicitly define the target arch as you have in your solution.

1 Like

@shaunmulligan is this still the case? Will adding in a Docker Hub image to my compose file be pulled as x86 even though I have specified an Arm device in Open Balena?

Hey Maggie,

I have asked my colleagues for some updates on this issue.

We will get back to you. Thanks

Hello again :slight_smile:

Support for multi-arch images has been added to balenaCloud. Unfortunately, this is still not supported by openBalena(yet?). Here is the GH issue tracking it and I believe you already saw that . We are still working on this a will get back to you once we have some updates on this.

Thanks

1 Like

Support for multi-arch images has been added to balenaCloud.

To clarify, at the time of this writing, even balenaCloud support for multi-arch images is limited to the balena push myApp CLI command, that uses the balenaCloud builders. The following CLI commands still do not have support for multi-arch images, whether deploying to balenaCloud or openBalena:

  • balena push <ip address>
  • balena build
  • balena deploy

Another relevant GitHub issue for tracking progress is https://github.com/balena-io/balena-cli/pull/2145

1 Like