error while loadingDocker: shared libraries: libsystemd-journal.so.0: cannot open shared object file: No such file or directory error while loadingDocker: shared libraries: libsystemd-journal.so.0: cannot open shared object file: No such file or directory docker docker

error while loadingDocker: shared libraries: libsystemd-journal.so.0: cannot open shared object file: No such file or directory


After multiple comments on the previous question, the OP Jenson confirms making it work with:

I will have to make a dockerfile because the run command is too much.
But it works at the moment:

docker run -d --name jenkins --volumes-from jenkins-dv --privileged=true \-t -i \-v /var/run/docker.sock:/var/run/docker.sock -v $(which docker):/bin/docker \ -v /lib64/libsystemd-journal.so.0:/usr/lib/libsystemd-journal.so.0 \-v /lib64/libsystemd-id128.so.0:/usr/lib/libsystemd-id128.so.0 \-v /lib64/libdevmapper.so.1.02:/usr/lib/libdevmapper.so.1.02 \-v /lib64/libgcrypt.so.11:/usr/lib/libgcrypt.so.11 \-v /lib64/libdw.so.1:/usr/lib/libdw.so.1 \-p 8080:8080 jenkins

I mentioned that running docker from a container ("cic": "container-in-container") means mounting the docker executable and /var/run/docker.sock.
Apparently, that particular image needs a bit more to run from within a container.


For my developer environment, I'm runnining docker-compose and I connect to the ubuntu image container (14.04 LTS) (I mount the /var/run/docker.sock as well).

Since an update of my host ubuntu system yesterday evening, I had the same error when I wanted to run a docker command inside the dev container :

[dev@docker_dev]:~$ docker psdocker: error while loading shared libraries: libsystemd-journal.so.0: cannot open shared object file: No such file or directory

So I did an update and I installed libsystemd-journal0 :

[dev@docker_dev]:~$ sudo apt-get update[dev@docker_dev]:~$ sudo apt-get install libsystemd-journal0

And now my dev container is working fine with docker commands


From the error, it appears that the shared library required by your executable is missing. One way to resolve this issue is:

  1. Use "COPY" command inside Dockerfile to copy the shared libraries/dependencies inside the container. Example: COPY {local_path} {docker_path}
  2. Then, set the environment variable where shared libraries are searched for first before the standard set of directories. For instance for Linux based OS, LD_LIBRARY_PATH is used. Environment variables can be set via Docker's Environment replacement (ENV). Example: ENV LD_LIBRARY_PATH={docker_path}:$LD_LIBRARY_PATH

Other is to statically link your binary with the dependencies (language dependent).