processone / docker-ejabberd

Set of ejabberd Docker images
94 stars 77 forks source link

Provide image for arm architecture (like Raspberry Pi) #71

Closed garret closed 2 years ago

garret commented 3 years ago

Would it be possible to provide also an official image for devices like the Raspberry Pi? ejabberd is so great that it can easily run on such low-powered devices and makes so much sense when you want to self-host a local private session.

I think this might also be easily achieved by the new docker buildx function that automatically creates images for other architectures, such as arm.

ballerburg9005 commented 3 years ago

Yes, you can build multiple architectures in one single command with Docker Buildx. I wrote a quick tutorial here:

https://ballerburg.us.to/index.php/howto-multi-architecture-builds-in-docker/

garret commented 3 years ago

@ballerburg9005 your reply was addressed to me or to the developers of ejabberd?

ballerburg9005 commented 3 years ago

@garret The developers.

ballerburg9005 commented 3 years ago

I hope the Ejabberd devs will switch to Buildx soon as suggested.

Until then I made a slightly modified build myself:

https://hub.docker.com/r/ballerburg9005/docker-ejabberd-ecs-official-arm https://github.com/ballerburg9005/docker-ejabberd

I tested everything and I wrote everything down on Dockerhub that is not already part of the official tutorials and manuals. DynDNS, STUN/TURN Video calls and everything all working.

Check out the Dockerfile of my fork. It contains a docker hack with netstat to install contrib modules from ejabberdctl without docker failing. It works 99% of the time.

mrusme commented 2 years ago

Any news on this? I, too, would like to use the official images on linux/arm64/v8 but only linux/amd64 seem to be available.

//edit: I just tried building it myself and it seems the issue is rooted even deeper:

docker build -t ejabberd/ecs .
Sending build context to Docker daemon  5.114MB
Step 1/32 : FROM ejabberd/mix as builder
latest: Pulling from ejabberd/mix
c9b1b535fdd9: Already exists
ec82cf85f17e: Pull complete
bdf3f11358e7: Pull complete
Digest: sha256:ea01f62fcbd27b13119195b1b7e2d69a1e48c21e77a6c2b14ebf7ec12a57dc21
Status: Downloaded newer image for ejabberd/mix:latest
 ---> 6eaa7aedcda9
Step 2/32 : ARG VERSION
 ---> [Warning] The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
 ---> Running in 3e29cf0dc104
Removing intermediate container 3e29cf0dc104
 ---> 6271fc9d51b6
Step 3/32 : ENV VERSION=${VERSION:-latest}     MIX_ENV=prod
 ---> [Warning] The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
 ---> Running in 748c4f65c3f6
Removing intermediate container 748c4f65c3f6
 ---> 66294da94f7b
Step 4/32 : LABEL maintainer="ProcessOne <contact@process-one.net>"     product="Ejabberd Community Server builder"
 ---> [Warning] The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
 ---> Running in f95a641b97c6
Removing intermediate container f95a641b97c6
 ---> 9fc401bb0442
Step 5/32 : RUN git clone https://github.com/processone/ejabberd.git
 ---> [Warning] The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
 ---> Running in 170d5cad42a7
exec /bin/sh: exec format error
The command '/bin/sh -c git clone https://github.com/processone/ejabberd.git' returned a non-zero code: 1

//edit 2: Building the mix subfolder using docker build -t ejabberd/mix . first fixed the issue with building ecs.

ballerburg9005 commented 2 years ago

Check out my modified build, it explains what you have to do.

badlop commented 2 years ago

BTW, since ejabberd 22.05, a new alternative container image is available in https://github.com/processone/ejabberd/pkgs/container/ejabberd and it's built for x64 and arm64.