Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker: error while loading shared libraries: libsystemd-journal.so.0: cannot open shared object file: No such file or directory #19230

Closed
lvthillo opened this issue Jan 11, 2016 · 17 comments

Comments

@lvthillo
Copy link

I'm using Docker version:

Client:
 Version:      1.9.1
 API version:  1.21
 Go version:   go1.4.2
 Git commit:   a34a1d5
 Built:        Fri Nov 20 13:25:01 UTC 2015
 OS/Arch:      linux/amd64

Server:
 Version:      1.9.1
 API version:  1.21
 Go version:   go1.4.2
 Git commit:   a34a1d5
 Built:        Fri Nov 20 13:25:01 UTC 2015
 OS/Arch:      linux/amd64

I have a Jenkins-container running in my Docker Environment.
When I'm accessing the Jenkins-container and try to perform a Docker-command I got this error:

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

I tried:

[root@localhost ~]#  cd /lib64/
[root@localhost lib64]# ln -s /lib64/libdevmapper.so.1.02 /lib64/libdevmapper.so.1.02.1
[root@localhost lib64]# ldconfig 
[root@localhost lib64]# ldconfig -v |grep libdevmapper.so.1.02.1 libdevmapper.so.1.02 -> libdevmapper.so.1.02.1
grep: input file ‘libdevmapper.so.1.02’ is also the output
ldconfig: Can't stat /libx32: No such file or directory
ldconfig: Path `/usr/lib' given more than once
ldconfig: Path `/usr/lib64' given more than once
ldconfig: Can't stat /usr/libx32: No such file or directory
ldconfig: File /lib64/libdevmapper.so.1.02.1 is empty, not checked.
ldconfig: File /lib64/libdevmapper.so.1.02 is empty, not checked.
[root@localhost lib64]# docker
docker: error while loading shared libraries: /lib64/libdevmapper.so.1.02: file too short
@GordonTheTurtle
Copy link

If you are reporting a new issue, make sure that we do not have any duplicates already open. You can ensure this by searching the issue list for this repository. If there is a duplicate, please close your issue and add a comment to the existing issue instead.

If you suspect your issue is a bug, please edit your issue description to include the BUG REPORT INFORMATION shown below. If you fail to provide this information within 7 days, we cannot debug your issue and will close it. We will, however, reopen it if you later provide the information.

For more information about reporting issues, see CONTRIBUTING.md.

You don't have to include this information if this is a feature request

(This is an automated, informational response)


BUG REPORT INFORMATION

Use the commands below to provide key information from your environment:

docker version:
docker info:

Provide additional environment details (AWS, VirtualBox, physical, etc.):

List the steps to reproduce the issue:
1.
2.
3.

Describe the results you received:

Describe the results you expected:

Provide additional info you think is important:

----------END REPORT ---------

#ENEEDMOREINFO

@thaJeztah
Copy link
Member

When I'm accessing the Jenkins-container and try to perform a Docker-command

Can you show the exact steps? Is this error inside the container? Are you running docker-in-docker?

@allamand
Copy link

@lorenzvth7, I encountered the same problem while using the image jenkins from rancher catalog where by default they use to bind-mount docker inside the container

volumes:
- '/var/run/docker.sock:/var/run/docker.sock'
- '/usr/bin/docker:/usr/bin/docker'

In my case my os was centos and inside the container the os is debian so docker won't work.

I fix this by installing proper docker binary inside the jenkins(debian) container and only bind-mound the docker socket.

@cpuguy83
Copy link
Member

Yes, if you installed docker from the official apt/yum repos, then it is a dynamically linked binary and just bind-mounting it into the container isn't enough to make it work.

@thaJeztah
Copy link
Member

I'm going to close this issue, because (as @cpuguy83 explained) this looks like a user error, but feel free to comment here after I've closed

@kevinsimper
Copy link

@cpuguy83 How can you make it then?

@lvthillo
Copy link
Author

@thaJeztah @cpuguy83 @kevinsimper It was indeed a user-error. I had to mount the shared object files.

@kevinsimper
Copy link

Yes, but a found the solution. It is just to download the docker binary and use that, since it is only the client you need inside the container 👍

@thaJeztah
Copy link
Member

@kevinsimper in case it's useful; there's also official images containing docker; https://hub.docker.com/_/docker/

@kevinsimper
Copy link

@thaJeztah Nice, thanks you! :)

@tnguyen14
Copy link

@kevinsimper by just downloading the docker binary, do you mean doing something like apt-get install docker-engine?

@kevinsimper
Copy link

@tnguyen14 It is the opposite you want, you can just grab it from github release https://github.com/docker/docker/releases

@thaJeztah
Copy link
Member

@kevinsimper @tnguyen14 you can get it even easier; use the official docker image on Docker Hub; https://hub.docker.com/_/docker/

(just realized I already mentioned that above, haha)

@kevinsimper
Copy link

@thaJeztah I needed the docker client inside my node.js app, so I needed the cli directly :)

@tnguyen14
Copy link

@thaJeztah True, but I'm trying to get the docker client inside a jenkins image, which is not based off of the docker image. Unless there is a way to somehow replicate the features from the docker image?

@kevinsimper I ended up doing RUN curl -L https://get.docker.com/builds/Linux/x86_64/docker-latest > /usr/bin/docker && chmod +x /usr/bin/docker

@thaJeztah
Copy link
Member

@tnguyen14 just a heads up; with docker 1.11, docker is shipped as multiple binaries, and static binaries will be shipped as a .tgz archive, so it's best to pin your script to a specific version (instead of docker-latest), and update your script to work with the archive, once you're switching to 1.11

@tnguyen14
Copy link

Thanks for the heads up @thaJeztah. I modified my script to be RUN curl -L https://get.docker.com/builds/Linux/x86_64/docker-1.10.3 > /usr/bin/docker && chmod +x /usr/bin/docker

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants