libreofficedocker / libreoffice-unoserver

A packaged unoserver with REST APIs using Libreoffice in Docker
Apache License 2.0
10 stars 6 forks source link

Arm64 docker images all contain x86 unoserver-rest-api binary #4

Closed ofipify closed 1 year ago

ofipify commented 1 year ago

Thank you for doing this, it's an amazing project.

One thing I've noticed is that the image doesn't work on arm64 architecture.

# On an arm64 machine, e.g. an M2 Macbook
$ docker run libreofficedocker/libreoffice-unoserver:3.18
s6-rc: info: service unoserver-rest-api: starting
s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service unoserver-rest-api successfully started
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
qemu: uncaught target signal 11 (Segmentation fault) - core dumped
Segmentation fault
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service update-font-cache: starting
s6-rc: info: service update-font-cache successfully started
s6-rc: info: service unoserver: starting
s6-rc: info: service unoserver successfully started
s6-rc: info: service legacy-services: starting
s6-rc: info: service legacy-services successfully started
INFO:unoserver:Starting unoserver.
INFO:unoserver:Command: libreoffice --headless --invisible --nocrashreport --nodefault --nologo --nofirststartwizard --norestore -env:UserInstallation=file:///tmp/tmpmu2rk3sk --accept=socket,host=127.0.0.1,port=2002,tcpNoDelay=1;urp;StarOffice.ComponentContext
INFO:unoserver:Server PID: 110
qemu: uncaught target signal 11 (Segmentation fault) - core dumped
Segmentation fault
docker-cmd.sh [Thu Jul 20 13:06:01 UTC 2023]: Alpine Linux version: 3.18.2
docker-cmd.sh [Thu Jul 20 13:06:01 UTC 2023]: Python version: Python 3.11.4
docker-cmd.sh [Thu Jul 20 13:06:01 UTC 2023]: openjdk 11.0.19 2023-04-18
docker-cmd.sh [Thu Jul 20 13:06:01 UTC 2023]: OpenJDK Runtime Environment (build 11.0.19+7-alpine-r1)
docker-cmd.sh [Thu Jul 20 13:06:01 UTC 2023]: OpenJDK 64-Bit Server VM (build 11.0.19+7-alpine-r1, mixed mode)
docker-cmd.sh [Thu Jul 20 13:06:01 UTC 2023]: LibreOffice 7.5.3.2 50(Build:2)
qemu: uncaught target signal 11 (Segmentation fault) - core dumped
Segmentation fault
qemu: uncaught target signal 11 (Segmentation fault) - core dumped
Segmentation fault
qemu: uncaught target signal 11 (Segmentation fault) - core dumped
Segmentation fault
qemu: uncaught target signal 11 (Segmentation fault) - core dumped
Segmentation fault
^Cs6-rc: info: service legacy-services: stopping
s6-rc: info: service legacy-services successfully stopped
s6-rc: info: service unoserver-rest-api: stopping
s6-rc: info: service unoserver: stopping
s6-rc: info: service unoserver-rest-api successfully stopped
s6-rc: info: service unoserver successfully stopped
s6-rc: info: service update-font-cache: stopping
s6-rc: info: service update-font-cache successfully stopped
s6-rc: info: service legacy-cont-init: stopping
s6-rc: info: service legacy-cont-init successfully stopped
s6-rc: info: service fix-attrs: stopping
s6-rc: info: service fix-attrs successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped
INFO:unoserver:Sending signal to LibreOffice

Note the Segmentation faults

Running the image on it's own, skipping the service start and just shell reveals the following:

$ docker run -it --entrypoint /bin/sh libreofficedocker/libreoffice-unoserver:3.18
/ # apk add file
fetch https://dl-cdn.alpinelinux.org/alpine/v3.18/main/aarch64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.18/community/aarch64/APKINDEX.tar.gz
(1/2) Installing libmagic (5.44-r4)
(2/2) Installing file (5.44-r4)
Executing busybox-1.36.1-r0.trigger
OK: 1416 MiB in 385 packages
/ # file /usr/bin/unoserver-rest-api
/usr/bin/unoserver-rest-api: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, no section header
/ # uname -a
Linux 31932bb42c22 5.15.49-linuxkit-pr #1 SMP PREEMPT Thu May 25 07:27:39 UTC 2023 aarch64 Linux

As you can see, the unoserver-rest-api is an x86-64 binary.

socheatsok78 commented 1 year ago

Hi @ofipify apology for the inconvenience.

This is due to the the container image has been rework before the unoserver-rest-api. Anyway the unoserver-rest-api now have arm64 binary starting from v0.8.0.

All images should now have the correct binary to start.

ofipify commented 1 year ago

Hi @socheatsok78,

Thank you for fixing it so fast. I can confirm that this now works on arm64. I've tested it earlier and it all worked as expected.

Kind regards, @ofipify