I solved this issue using these steps
Issue:
root@81d156e97b9c:/# docker -v
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)
First of all
- build image from docker file:
this is Docker file content for record
FROM jenkins/jenkins:lts
USER root
RUN apt-get update && \
apt-get -y install apt-transport-https \
ca-certificates curl gnupg2 \
software-properties-common && \
curl -fsSL https://download.docker.com/linux/$(. /etc/os-release; echo "$ID")/gpg > /tmp/dkey; apt-key add /tmp/dkey && \
add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/$(. /etc/os-release; echo "$ID") \
$(lsb_release -cs) \
stable" && \
apt-get update && \
apt-get -y install docker-ce
USER jenkins
using this command
docker build -t custom-jenkins-docker:v1 .
image size was 1.04Gb in my case (for knowledge)
then run this command to make container of that image
docker run -p 8080:8080 -p 50000:50000 -d -v jenkins_home:/var/jenkins_home -v /var/run/docker.sock:/var/run/docker.sock custom-jenkins-docker:v1
Know the CONTAINER ID
docker ps
after that enter exec mode in bash shell as root user
docker exec -u 0 -it 557c4a24ff3f bash
Now you can use docker commands
But What if I want to access docker using normal user?
then we have to change permissions of docker.sock file to 666 instead of 660 in host machine
sudo chmod 666 /var/run/docker.sock
run this command inside container
docker exec -it 557c4a24ff3f bash
Now you can use Docker as Normal user