Search code examples
docker

How to update glibc in docker image


I am currently using docker, and I require glibc 2.28 on it. However, node:latest only gives me 2.24 on my ARM device. I have tried running update/upgrade, but it has not helped. What is the best way to continue? Should I look for a different image and install node manually?

FROM node:latest
WORKDIR /code
RUN apt update
RUN apt upgrade -y

Solution

  • Upgrading very core libraries like libc can be challenging. It's better to find a newer distribution if you can.

    If you look at the Docker Hub node image page, you'll notice that the "latest" image is also "15-stretch"; there is also a "15-buster". These are the names of Debian GNU/Linux releases. "Stretch" is an older release, and "buster" is the current stable Debian release. If you further look at the Debian package page for the libc6 package you'll see that in fact "buster" has GNU libc 2.28, where "stretch" only has libc 2.24.

    So the easiest way to get the newer version of libc is to explicitly request the newer version of Debian as the base for the Node installation:

    FROM node:current-buster