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"