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.