Skip to content

Instantly share code, notes, and snippets.

@ziadoz
Last active June 30, 2022 06:53
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ziadoz/ee2e73450c344f1953e53c018a2a63a7 to your computer and use it in GitHub Desktop.
Save ziadoz/ee2e73450c344f1953e53c018a2a63a7 to your computer and use it in GitHub Desktop.
Install glibc on PHP Alpine Docker Image
FROM php:8-cli-alpine
# @see: @see: https://stackoverflow.com/a/65969295
RUN apk --no-cache add binutils curl \
&& GLIBC_VER=$(curl -s https://api.github.com/repos/sgerrand/alpine-pkg-glibc/releases/latest | grep tag_name | cut -d : -f 2 | tr -d \",' ') \
&& curl -sL https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub -o /etc/apk/keys/sgerrand.rsa.pub \
&& curl -sLO https://github.com/sgerrand/alpine-pkg-glibc/releases/download/${GLIBC_VER}/glibc-${GLIBC_VER}.apk \
&& curl -sLO https://github.com/sgerrand/alpine-pkg-glibc/releases/download/${GLIBC_VER}/glibc-bin-${GLIBC_VER}.apk \
&& apk add --no-cache \
glibc-${GLIBC_VER}.apk \
glibc-bin-${GLIBC_VER}.apk \
&& apk --no-cache del binutils curl \
&& rm glibc-${GLIBC_VER}.apk \
&& rm glibc-bin-${GLIBC_VER}.apk \
&& rm -rf /var/cache/apk/*
@ziadoz
Copy link
Author

ziadoz commented Jun 29, 2022

@vincentchalamon Good spot. I've changed it. 👍

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