The Docker command cannot be run in jenkins container

  docker, question

Now build jenkins container

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

After the above execution, the container has been successfully started.

But the Docker command was run inside the Jenkins container.

The results failed and the following problems occurred.

docker: error while loading shared libraries: libdevmapper.so.1.02: cannot open shared object file: No such file or directory

I tried to join this:

-v /lib64/libdevmapper.so.1.02:/usr/lib/libdevmapper.so.1.02

As a result, another problem has arisen:

docker: error while loading shared libraries: libudev.so.0: cannot open shared object file: No such file or directory

I don’t think there is any need to try next, which means there is no solution.

Change to root