anthonyraymond / joal

An open source command line RatioMaster with an optional WebUI.
Apache License 2.0
612 stars 65 forks source link

[Docker image joal:arm] Support for Raspberry Pi Zero (linux/arm/v6) #83

Open mvallerie opened 5 years ago

mvallerie commented 5 years ago

Hello,

First of all, thanks for this great software.

I intended to run joal on an old RPI Zero (without wireless). It's an ARMv6 CPU. Nothing happens when i'm trying to run joal:arm using docker on the Pi Zero (no output, nothing in the logs, nothing in the docker log, container not running). Even a docker run --entrypoint /bin/sh ... was just returning without giving me a shell prompt.

Joal's docker images are based on maven:3.6-jdk-8 and openjdk:8u181-jre. When i'm trying to run those images on the Pi Zero with a custom --entrypoint, they don't run, as the main image. For the maven:3.6-jdk-8 image, that's not surprising since this image is only for amd64. That only matters if you intend to build the image directly on your Pi Zero (which i was able to do then...and it took more than 2 hours, so i won't try that again).

But, more importantly, i noticed openjdk:8u181-jre supports only arm/v5, arm/v7, and arm64/v8 according to Docker Hub. On the other hand, openjdk:8u181-jre-alpine supports arm/v6 and arm64/v8. After checking, the Pi Zero was able to run this image. I rebuilt a custom joal image on my laptop based on the alpine version of openjdk and the alpine version of maven (to be consistent), pushed it to the Pi Zero, and voilà ! The JVM takes a good 15 minutes to start, but then, it becomes very usable.

Now the problem is, openjdk:8u181-jre-alpine doesn't support arm/v5 and arm/v7. I guess there is a way to get joal images to support both using buildx ACLs and multiple Dockerfiles. You would have 1 Dockerfile for arm/v6 and another one for others. But this would mean a tag for arm/v6, and another one for all others...not exactly "pretty", and can be confusing.

In case you want to check what i did exactly, here is my fork, i only changed the Dockerfile. Thanks in advance.

anthonyraymond commented 5 years ago

Hello @mvallerie,

Thats unfortunate you are on the only arm arch which is not supported x)

I'm not quite into havng multiple Dockerfile for the reasons you well explained, more than that i'm hesitating between two options at the moment:

At the moment i'm not coding for this project but i'm likely to reboot the project as Golang in the future.

For the time being and for the futures releases i think you'll have to have your own fork of Joal to run it on the arm/v6.

Anyway thanks for the investigation :) and GG for the fix.

I'll keep you updated about the "maybe" Golang reboot.

mvallerie commented 5 years ago

@anthonyraymond

All right, thanks for your feedback and your clarifications. For now, I'm just going to keep using my own Dockerfile.

Using Golang would probably make the whole thing faster, I support the idea. I actually thought myself about rewriting to Node (because running a JVM on the Pi Zero is not exactly a great idea), but that's neither a short nor an easy task. Anyway, I'll be happy to hear about it if you eventually do it.

anthonyraymond commented 4 years ago

@mvallerie The golang port is on the way ^^ i've just started working on it.