Skip to content

Instantly share code, notes, and snippets.

@larzza
Created June 24, 2019 20:35
Show Gist options
  • Star 14 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
  • Save larzza/0f070a1b61c1d6a699653c9a792294be to your computer and use it in GitHub Desktop.
Save larzza/0f070a1b61c1d6a699653c9a792294be to your computer and use it in GitHub Desktop.
Install glibc in Alpine docker image
RUN apk --no-cache add \
wget \
ca-certificates \
libstdc++
# Get and install glibc for alpine
ARG APK_GLIBC_VERSION=2.29-r0
ARG APK_GLIBC_FILE="glibc-${APK_GLIBC_VERSION}.apk"
ARG APK_GLIBC_BIN_FILE="glibc-bin-${APK_GLIBC_VERSION}.apk"
ARG APK_GLIBC_BASE_URL="https://github.com/sgerrand/alpine-pkg-glibc/releases/download/${APK_GLIBC_VERSION}"
RUN wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub \
&& wget "${APK_GLIBC_BASE_URL}/${APK_GLIBC_FILE}" \
&& apk --no-cache add "${APK_GLIBC_FILE}" \
&& wget "${APK_GLIBC_BASE_URL}/${APK_GLIBC_BIN_FILE}" \
&& apk --no-cache add "${APK_GLIBC_BIN_FILE}" \
&& rm glibc-*
@emailyc
Copy link

emailyc commented Aug 23, 2023

gcompat should provide glibc on Alpine
apk update && apk add --no-cache gcompat libstdc++

Running_glibc_programs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment