Is there a best practice for setting up glibc on a docker alpine linux image?

Is there a best practice for setting up glibc on the docker alpine linux base image with the correct paths so that any spawned process can correctly reference the location of the installed libc libraries?

+16
source share
3 answers

Yes there is,

I used specially created glibc to install the 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

+11
source

It’s best not to install glibc on Alpine Linux. Instead, it uses musl libc , a lightweight, fast, simple, and standards-compliant C library (i.e. everything that glibc is not).

Instead of installing glibc on Alpine, build and / or package dependent software packages and libraries for Alpine.

  FROM alpine:3.4 RUN echo "http://dl-cdn.alpinelinux.org/alpine/latest-stable/main" > /etc/apk/repositories RUN echo "http://dl-cdn.alpinelinux.org/alpine/latest-stable/community" >> /etc/apk/repositories RUN apk --no-cache --update-cache add gcc gfortran python python-dev py-pip build-base wget freetype-dev libpng-dev openblas-dev RUN ln -s /usr/include/locale.h /usr/include/xlocale.h RUN pip install numpy scipy pandas matplotlib 
+1
source

apk add libgcc

This seems to make glibc available. This increases the image size by several MB.

0
source

All Articles