botamusique icon indicating copy to clipboard operation
botamusique copied to clipboard

Publish docker image for more cpu architectures

Open sethidden opened this issue 4 years ago • 6 comments

Is your feature request related to a problem? Please describe. I'm trying to start botamusique on docker on my raspberry pi 4b homeserver, but I'm getting

pi@raspberrypi:/mnt/ssd0/docker/umurmur $ docker logs botamusique
standard_init_linux.go:219: exec user process caused: exec format error
standard_init_linux.go:219: exec user process caused: exec format error
standard_init_linux.go:219: exec user process caused: exec format error
standard_init_linux.go:219: exec user process caused: exec format error

This error is kinda cryptic but I know that it's caused by installing a docker image on a computer whose CPU architecture it was not built for. I see on dockerhub botamusique is built only for amd64: image

But I'm trying to run it on Raspberry Pi which is armv7 (or arm64 if you're running a 64-bit system which is not the norm for Raspberry Pi since raspbian stable is 32-bit, but can be used (Rasperry Pi OS now comes in both 32-bit and 64-bit. Both variants are now stable. Before 64-bit was in beta, but that's not the case anymore)

Describe the solution you'd like In your Dockerfile in the repo root I can see that you use the python:slim as the base image, and luckily it supports many different CPU architectures, not only amd64: image The ones marked are most important for raspi, but supporting all architectures desn't really cost you anything.

You may be thinking "yo but I only have an amd64 PC, I can't build for other architectures", but luckily there's the docker buildx command that lets you build for an architecture you're not on.

Back in the day I made the umurmur-docker package with the aim to support many architectures and I've written some instructions on how to use docker buildx: https://github.com/sethidden/umurmur-docker/wiki/FAQ

Describe alternatives you've considered N/A

Additional context N/A

sethidden avatar Dec 20 '21 19:12 sethidden

Instead of Python, we rely heavily on FFmpeg and the platforms available are limited IIRC. @azlux Do you have any thoughts on it?

TerryGeng avatar Jan 11 '22 15:01 TerryGeng

@sethidden is the local dockerfile is working on armv7 (rapsberry 4) ? docker build -f Dockerfile.local . If yes, I need to work on other integration because of ffmpeg like @TerryGeng said.

azlux avatar Jan 11 '22 15:01 azlux

@azlux The command you provided builds and launches correctly (the error I posted in my OP isn't there anymore). Replaced my botamusique as systemd service with the built image. I had some problem where it froze at step 12 of the process but once I ran the build again it built correctly.

I'm not sure what do you mean regarding ffmpeg - if it built OK on the raspi won't it build at least for armv7 using docker buildx? Bullseye has access to the ffmpeg version packaged for arm in apt at least

sethidden avatar Jan 11 '22 16:01 sethidden

64-bit version of Raspberry Pi OS is out of beta (is stable) so it'd be a good idea to build for arm64 too.

sethidden avatar Feb 03 '22 20:02 sethidden

On the way with https://github.com/azlux/botamusique/commit/ff930393457b7f635dfab78793a51c3858f43b29

azlux avatar Mar 25 '22 12:03 azlux

Just tried out the azlux/botamusique:testing tag on the rpi 4b and it's working great :) Thank you!

docker-compse
version: "3.5"
services:
  murmur:
    container_name: murmur
    restart: always
    ports:
        - '64738:64738'
        - '64738:64738/udp'
    volumes:
      - '/mnt/ssd0/umurmur/murmur.ini:/etc/murmur.ini'
      - '/mnt/ssd0/certs:/etc/certs'
    image: sethidden/murmur
  botamusique:
    network_mode: host
    image: azlux/botamusique:testing
    container_name: botamusique
    hostname: XANA
    restart: on-failure
    expose:
      - 8181

sethidden avatar Mar 25 '22 21:03 sethidden