Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting `GLIBC_2.32' and `GLIBC_2.34' not found in Jenkins (Docker) with DinD on Ubuntu 22.04

I am trying to configure Jenkins as docker container with docker-in-docker on an EC2 instance running Ubuntu 22.04 but I am getting `GLIBC_2.32' and 'GLIBC_2.34' not found when I try to run a script containing docker command using docker plugin in Jenkins. I have followed this as reference for setting Jenkins on my localhost. When moved to remote, I get these errors

...
$ docker login -u username -p ******** https://registry.gitlab.com
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)
...

Here is the docker-compose.yaml file

version: '3.3'

services:
  docker-in-docker-container:
    image: docker:dind
    container_name: docker-in-docker-container
    user: root
    privileged: true
    expose:
      - 2375
    volumes:
      - ./data:/var/jenkins_home
    environment:
      DOCKER_TLS_CERTDIR: ""
    restart: on-failure

  jenkins-container: 
    image: jenkins/jenkins:lts-jdk17
    container_name: jenkins-container
    user: root
    depends_on:
      - docker-in-docker-container
    ports:
      - '8080:8080'
    privileged: true
    volumes:
      - ./data:/var/jenkins_home
      - /usr/bin/docker:/usr/bin/docker
    environment:
      DOCKER_HOST: tcp://docker-in-docker-container:2375
    restart: on-failure

I tried to use various images from the Jenkins docker repository like alpine, jdk8, jdk11, and jdk17, but no luck.

Here is ldd info for troubleshooting from host machine

ubuntu@ip-10-0-0-251:~$ ldd --version
ldd (Ubuntu GLIBC 2.35-0ubuntu3) 2.35
Copyright (C) 2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Roland McGrath and Ulrich Drepper.

Here is ldd info for Jenkins container

root@a2da70fc6100:/# ldd --version
ldd (Debian GLIBC 2.31-13+deb11u3) 2.31
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Roland McGrath and Ulrich Drepper.

Looking forward to any help! Thanks.

like image 761
Izhar Hussain Avatar asked Sep 11 '25 15:09

Izhar Hussain


1 Answers

Try UBUNTU 18.04LTS IT WILL WORK

Same error I got in Ubuntu 22.04lts on my Ec2 instance where I am trying to integrate docker to Jenkins container using docker runtime docker.sock by following command

docker run -d -p 8080:8080 -p 50000:50000 -v jenkins_home:/var/jenkins_home -v /var/run/docker.sock:/var/run/docker -v $(which docker):/usr/bin/docker  jenkins/jenkins:lts

docker exec -it -u 0 <container-id> bash

chmod 666 /var/run/docker.sock

It will allow docker runtime to integrate with jenkins

Tried docker pull

It threw me the same error

Getting 'GLIBC_2.32' and 'GLIBC_2.34' not found in Jenkins ( required by Docker)

The reason is Ec2 instance of Ubuntu 22.04lts has GLIBC 2.35

check this command in ece instance

ldd --version

But inside instance jenkins container has GLIBC 2.31 CHECK

ldd --version GLIBC 2.31

SO BECAUSE OF THIS DOCKER won't work inside that jenkins container in Ubuntu 22.04lts

Then I TRIED IN Ubuntu 18.04 LTS Use the same steps again

docker run -d -p 8080:8080 -p 50000:50000 -v jenkins_home:/var/jenkins_home -v /var/run/docker.sock:/var/run/docker -v $(which docker):/usr/bin/dock jenkins/jenkins:lts

docker exec -it -u 0 <container-id> bash

chmod 666 /var/run/docker.sock

Now check docker pull...

It worked perfectly

like image 115
Kalaimanims Avatar answered Sep 14 '25 09:09

Kalaimanims