Jenkins job fails when entering docker build stage:
docker build -t jumperiz/nodeapp .
Error message:
docker: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by docker)
docker: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by docker)
A picture of my build attached. Any guidance would be appreciated!
3
Answers
You need to install docker manually and you can follow this steps:
docker.sock
privilege to read and write for all users with:I had the same problem, as described in detail here.
To upgrade
libc
version in the Jenkins container to 2.35 (as shipped with Ubuntu Jammy installed on the host) I had to build my own Jenkins container based on this system (ubuntu:jammy
) and on JDK 17, using template from the official Debian-based one (sourced from here).Now GLIBC versions agree, and Docker-in-Docker Jenkins builds can be made using Docker installed on any host with Ubuntu Jammy (but not newer Ubuntu versions, given that next in line,
ubuntu:22.10
already has a newer version ofglibc=2.36
):Feel free to use this container maintained automatically for our internal use (it’s a Docker-in-Docker Jenkins-made-by-Jenkins pipeline:)
I’ve encountered the same problem.
This can happen when you mount the host’s docker binary, which relies on a different glibc version than the one in your Jenkins image.
To resolve this issue, I found the two following solutions:
You could build a custom Jenkins image based on the official template, using
ubuntu:jammy
instead ofDebian
. However, note that this approach has some drawbacks. Specifically, any sibling docker containers created by Jenkins will also need to have glibc 2.35, which means you’ll need to modify and build those images yourself usingjammy
buildpack-deps.Alternatively, you could install docker inside the Dockerfile instead of mounting the host’s docker binary. This will enable Jenkins to use its own docker client and communicate with the docker engine using only the mounted docker socket. This approach is generally better since it ensures that Jenkins uses its own docker client, avoiding any dependency conflicts with the host’s docker binary.