So, finally we got an Alpine Repository running. “Let’s build a Java image on top of that, like, right now!”, I greenly said to my colleague, not knowing, that it will not be that easy.

Let’s start with some basic details about Alpine Linux. It is a Linux distribution built on top of musl and BusyBox. Alpine enables us to build very small images, since it is stripped of almost everything.

Alpine Linux is a security-oriented, lightweight Linux distribution based on musl libc and busybox.

Wait a moment.. musl instead of glibc? A quick Google search confirmed the bad feeling I’ve had after receiving the first weird error messages from the freshly built container. Oracle JRE, as well as Oracle JDK are not compatible with musl. Unfortunately, glibc is a hard dependency of these packages. OpenJDK, on the other side, runs (thanks to Project Portola) on musl-based environments.

You will find some instructions on how to run Oracle Java on Alpine, but I sense a “workaroundy” aftertaste in such solutions.