skip to Main Content

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!


Jenkins screenshot

3

Answers


  1. You need to install docker manually and you can follow this steps:

    • run jenkins container on detached mode:
      docker run -p 8080:8080 -p 50000:50000 -d -v /var/run/docker.sock:/var/run/docker.sock -v jenkins_home:/var/jenkins_home jenkins/jenkins:lts
      
    • Enter the jenkins container as root user:
      docker exec -it -u0 <container id> bash
      
    • Install docker:
      curl https://get.docker.com > dockerinstall && chmod 777 dockerinstall && ./dockerinstall
      
    • And then exit the Jenkins container and change docker.sock privilege to read and write for all users with:
      sudo chmod 666 /var/run/docker.sock
      
    Login or Signup to reply.
  2. 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 of glibc=2.36):

    $ ldd --version
    ldd (Ubuntu GLIBC 2.35-0ubuntu3.1) 2.35
    
    # vs.
    
    $ docker run --rm -it mirekphd/jenkins-jdk17-on-ubuntu2204:latest ldd --version
    ldd (Ubuntu GLIBC 2.35-0ubuntu3.1) 2.35
    

    Feel free to use this container maintained automatically for our internal use (it’s a Docker-in-Docker Jenkins-made-by-Jenkins pipeline:)

    Login or Signup to reply.
  3. 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 of Debian. 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 using jammy 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.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search