Is there a best practice on setting up glibc on docker alpine linux base image with correct paths so any spawned process can correctly reference the location of the installed libc libraries?
If you want to run glibc programs in Alpine Linux, there are a few ways of doing so. You can install the gcompat compatibility layer, you can install glibc alongside musl (manually, as it isn't packaged), or you could do it the easy way and use either Flatpak (the easiest) or a chroot.
Alpine Linux won't always be the right OS choice for IT teams, but it's an option worth consideration when lightweight container images are the goal. When it comes to Docker, sometimes less is more -- a maxim that applies especially to the base OS images installed in each Docker image.
Alpine is a suitable Linux distribution for production because it only has the bare necessities that your application needs to run. In this tutorial, you'll optimize Docker images in a few simple steps, making them smaller, faster, and better suited for production.
Yes there is,
I've used a custom built glibc to install a JRE on it.
You can find it here
You can use wget or curl to get the code and apk to install them
UPDATED commands see comments below
apk --no-cache add ca-certificates wget wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.28-r0/glibc-2.28-r0.apk apk add glibc-2.28-r0.apk
It worked perfectly for me
Installing the glibc compatibility libraries has worked for me so far every time
apk add gcompat
https://pkgs.alpinelinux.org/package/edge/community/x86_64/gcompat
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With