https://kotlinlang.org logo
Title
s

spierce7

06/03/2022, 1:30 AM
I used Compose JVM to create an image generation server, which is significantly faster than HTML Image generation methods I’ve found for servers. I wasn’t able to get compose running on Alpine Linux via Docker. The JVM was crashing. I was however able to get it running on Ubuntu Linux via docker just by adding the packages
libgl1-mesa-glx
and
libfontconfig
. Image generation is slower on a server than a laptop, which is a little unexpected, but I suspect it’s because all rendering is being done with a CPU, and no GPU. As things stand I’m generating simple 4k images in ~300 - 500 millis.
:party-parrot: 1
m

mikehearn

06/03/2022, 9:35 AM
You need a special JVM build to run on Alpine. muslc isn't 100% compatible with glibc. Unfortunately: https://jdk.java.net/18/ • The Alpine Linux build previously available on this page was removed as of the first JDK 18 release candidate. It's not production-ready because it hasn't been tested thoroughly enough to be considered a GA build. Please use the early-access JDK 19 Alpine Linux build in its place.
You could try using Google's minimal docker images for the JVM though.
Those are pretty small.
s

spierce7

06/03/2022, 2:36 PM
@mikehearn I was running it on amazoncorretto alpine as a base image, which the JVM works great on normally. Or are you saying I’d need a special JVM for compose on alpine?
muslc isn’t 100% compatible with glibc
This went over my head 😛 I just saw certain files that skia was looking for, found packages that provided those files, and added them. I’m a bit out of my depth on this.
m

mikehearn

06/03/2022, 3:04 PM
Generally any native code may need special recompilation and support for alpine. it's probably not worth the effort. if amazon are supporting jvm on alpine before upstream is, good for them, but it doesn't mean every library will work
👍 1
👍🏻 1
s

spierce7

06/03/2022, 5:04 PM
makes sense
thanks for taking the time to explain!