Description of problem: dockerinit fails with "libdevmapper.so.1.02: cannot open shared object file" Version-Release number of selected component (if applicable): docker-io-0.7-0.12.dm.fc19.x86_64.rpm How reproducible: Every time Steps to Reproduce: 1. Install docker-io-0.7-0.12.dm.fc19.x86_64.rpm on F19 2. Download official ubuntu image 3. docker run ubuntu echo "hello world" Actual results: /.dockerinit: error while loading shared libraries: libdevmapper.so.1.02: cannot open shared object file: No such file or directory Expected results: Get "hello world" output from ubuntu container
Got the RPM from http://lsm5.fedorapeople.org/rpmbuild/RPMS/x86_64/docker-io-0.7-0.12.dm.fc19.x86_64.rpm Also ldd on /usr/bin/docker-init: # ldd /usr/bin/docker-init linux-vdso.so.1 => (0x00007ffff97fe000) libdevmapper.so.1.02 => /lib64/libdevmapper.so.1.02 (0x0000003597e00000) libpthread.so.0 => /lib64/libpthread.so.0 (0x0000003597200000) libc.so.6 => /lib64/libc.so.6 (0x0000003596a00000) libselinux.so.1 => /lib64/libselinux.so.1 (0x0000003598200000) libsepol.so.1 => /lib64/libsepol.so.1 (0x0000003599a00000) libudev.so.1 => /lib64/libudev.so.1 (0x000000359ae00000) /lib64/ld-linux-x86-64.so.2 (0x0000003596600000) libdl.so.2 => /lib64/libdl.so.2 (0x0000003596e00000) libpcre.so.1 => /lib64/libpcre.so.1 (0x0000003597a00000) librt.so.1 => /lib64/librt.so.1 (0x0000003598a00000) libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x0000003598600000)
Also related: bug 1017186 (can't compile dockerinit statically with go 1.1)
Alex, can you comment on why docker-init requires libdevmapper? Is it for Docker-in-Docker?
just throwing it out there: this also occurs with centos and busybox containers
docker-init should not need libdevmapper. I don't know what branch this is build from. but the fixes for docker-init was on a different branch than the dm work unfortunately which lead to this. In general, the DM work is not yet landed, and is being reworked (again) upstream, including changing the on-disk layout. Trying to support the pre 0.7.0 releases is not really a good idea, lets finish this upstream first.
*** Bug 1028670 has been marked as a duplicate of this bug. ***
This occurs with the official centos 6 image, but not with quagbrain/centos5.9 image.
This is a direct result of how the "docker-init" binary was created (non-static), and is one of several reasons why docker is distributed as a static binary. We do have a new build script that will build a separate static dockerinit however, and it is available by invoking "./hack/make.sh dynbinary" (designed specifically with packagers in mind). So assuming you use a git revision that includes the "hack/make/dynbinary" file (which was commit 21161dbd515fb97cf9052a5980de6fc6180a89dc), you can replace the following build lines in your spec file: --- # passing version information build flags BZ #1017186 export LDFLAGS="-X main.GITCOMMIT %{shortcommit}/%{release} -X main.VERSION %{version} -w" go build -v -a -ldflags "$LDFLAGS" github.com/dotcloud/docker/docker go build -v -a -ldflags "$LDFLAGS" github.com/dotcloud/docker/docker-init popd --- With: --- popd ./hack/make.sh dynbinary --- Then, the install lines: --- install -p -m 755 _build/docker %{buildroot}%{_bindir} install -p -m 755 _build/docker-init %{buildroot}%{_bindir} --- With: --- install -d %{buildroot}%{_libexecdir}/docker install -p -m 755 bundles/$(cat VERSION)/dynbinary/docker-$(cat VERSION) %{buildroot}%{_bindir}/docker install -p -m 755 bundles/$(cat VERSION)/dynbinary/dockerinit-$(cat VERSION) %{buildroot}%{_libexecdir}/docker/dockerinit --- This method will allow for building dockerinit statically, even while using Go 1.1.2.
0.7-rc5 has been submitted to rawhide by vbatts
The error still occurs for me running the new version: [dkl@localhost ~]$ docker run -i -t centos bash /.dockerinit: error while loading shared libraries: libdevmapper.so.1.02: cannot open shared object file: No such file or directory RPM: http://koji.fedoraproject.org/koji/buildinfo?buildID=479658 docker-io-0.7-0.16.rc6.fc20
(In reply to Dave Lawrence from comment #10) > The error still occurs for me running the new version: > > [dkl@localhost ~]$ docker run -i -t centos bash > /.dockerinit: error while loading shared libraries: libdevmapper.so.1.02: > cannot open shared object file: No such file or directory This is reported in bug 1032884.
Ignore my previous comment :)
I can confirm this issue. It seems it depends on the image we want to run. Fedora images work good, whereas centos image has issues: Uploading context 10240 bytes Step 1 : FROM centos ---> 539c0211cd76 Step 2 : RUN yum -y install openssh-server ---> Running in a7fde642db8a /.dockerinit: error while loading shared libraries: libdevmapper.so.1.02: cannot open shared object file: No such file or directory Error build: The command [/bin/sh -c yum -y install openssh-server] returned a non-zero code: 127 I'm not sure if this is a docker-io package issue or the image itself.
Forgot to mention that I use docker-io-0.7-0.13.dm.fc20.x86_64. P.S. Sorry for the spam.
Good to know. I was thinking it had something to do with the images. The latest builds of docker-io have a statically linked dockerinit. Until it gets promoted, you could try the builds from koji http://koji.fedoraproject.org/koji/buildinfo?buildID=479658 Similarly for the centos image. Perhaps just mockbuild --rebuild the srpm for a centos machine, and install that rpm for the image.
(In reply to Vincent Batts from comment #15) > Until it gets promoted, you could try the builds from koji > http://koji.fedoraproject.org/koji/buildinfo?buildID=479658 Are you saying the rpm at the above links includes the newer staticly linked dockerinit, as that package still exhibits the same error for me? Or is there a new build coming through the system? dkl
(In reply to Dave Lawrence from comment #16) > (In reply to Vincent Batts from comment #15) > > Until it gets promoted, you could try the builds from koji > > http://koji.fedoraproject.org/koji/buildinfo?buildID=479658 > > Are you saying the rpm at the above links includes the newer staticly linked > dockerinit, as that package still exhibits the same error for me? Or is > there a new build coming through the system? > > dkl Or maybe I do not understand properly how this works. Is the dockerinit injected into the container root at the time the container is created, or does the image that is downloaded from the docker registry already contain the dockerinit? If the latter, then is it that the centos image will need to be updated for it to work? dkl
I believe docker is running within the container or at least load libraries from it (with docker-io-0.7-0.16.rc6.fc19.x86_64). I get the error /.dockerinit: error while loading shared libraries: libdevmapper.so.1.02: cannot open shared object file: No such file or directory when trying docker run mattdm/fedora-small /bin/echo hello world I do get "hello world" if I manually add /usr/lib64/libdevmapper.so.1.02 to the mattdm/fedora-small image, and I get the corresponding "error while loading shared libraries" error if I manually move libsqlite3.so.0 out of the way, similarly for libpcre.so.1 .
Created attachment 828465 [details] dockerinit build process fix The problem was that /usr/bin/docker was built with the flag utils.IAMSTATIC, which made it map itself on /.dockerinit in the LXC. Attached is a patch to the spec file (applied to http://koji.fedoraproject.org/koji/buildinfo?buildID=480402) to not set IAMSTATIC on /usr/bin/docker, and also to set utils.INITSHA1 to the SHA1 of /usr/libexec/docker/dockerinit I've disabled __os_install_post's binary modification steps, as that interferes with docker's SHA1 check. Which this patch, I can run a CentOS in docker on Fedora: # cat /etc/redhat-release ; docker run -rm=true centos cat /etc/redhat-release Fedora release 19 (Schrödinger’s Cat) CentOS release 6.4 (Final)
(In reply to dan-fedora from comment #19) > Created attachment 828465 [details] > dockerinit build process fix I can verify that the above patch fixes the issue for me. dkl
+1 This patch fixes the issue for me too.
cool. I'm working it through the dists, and will push it out shortly.
docker-io-0.7-0.20.rc7.fc19 has been submitted as an update for Fedora 19. https://admin.fedoraproject.org/updates/docker-io-0.7-0.20.rc7.fc19
+1 Yes it helped.
docker-io-0.7-0.20.rc7.fc20 has been submitted as an update for Fedora 20. https://admin.fedoraproject.org/updates/docker-io-0.7-0.20.rc7.fc20
docker-io-0.7-0.20.rc7.el6 has been submitted as an update for Fedora EPEL 6. https://admin.fedoraproject.org/updates/docker-io-0.7-0.20.rc7.el6
docker-io-0.7.0-2.el6 has been submitted as an update for Fedora EPEL 6. https://admin.fedoraproject.org/updates/docker-io-0.7.0-2.el6
docker-io-0.7.0-6.fc20 has been submitted as an update for Fedora 20. https://admin.fedoraproject.org/updates/docker-io-0.7.0-6.fc20
docker-io-0.7.0-6.fc19 has been submitted as an update for Fedora 19. https://admin.fedoraproject.org/updates/docker-io-0.7.0-6.fc19
docker-io-0.7.0-9.fc20 has been submitted as an update for Fedora 20. https://admin.fedoraproject.org/updates/docker-io-0.7.0-9.fc20
docker-io-0.7.0-9.fc19 has been submitted as an update for Fedora 19. https://admin.fedoraproject.org/updates/docker-io-0.7.0-9.fc19
docker-io-0.7.0-9.el6 has been submitted as an update for Fedora EPEL 6. https://admin.fedoraproject.org/updates/docker-io-0.7.0-9.el6
docker-io-0.7.0-10.fc20 has been submitted as an update for Fedora 20. https://admin.fedoraproject.org/updates/docker-io-0.7.0-10.fc20
docker-io-0.7.0-10.fc19 has been submitted as an update for Fedora 19. https://admin.fedoraproject.org/updates/docker-io-0.7.0-10.fc19
docker-io-0.7.0-10.el6 has been submitted as an update for Fedora EPEL 6. https://admin.fedoraproject.org/updates/docker-io-0.7.0-10.el6
docker-io-0.7.0-12.fc20 has been submitted as an update for Fedora 20. https://admin.fedoraproject.org/updates/docker-io-0.7.0-12.fc20
docker-io-0.7.0-12.fc19 has been submitted as an update for Fedora 19. https://admin.fedoraproject.org/updates/docker-io-0.7.0-12.fc19
docker-io-0.7.0-12.el6 has been submitted as an update for Fedora EPEL 6. https://admin.fedoraproject.org/updates/docker-io-0.7.0-12.el6
docker-io-0.7.0-14.fc20 has been submitted as an update for Fedora 20. https://admin.fedoraproject.org/updates/docker-io-0.7.0-14.fc20
docker-io-0.7.0-14.fc19 has been submitted as an update for Fedora 19. https://admin.fedoraproject.org/updates/docker-io-0.7.0-14.fc19
docker-io-0.7.0-14.el6 has been submitted as an update for Fedora EPEL 6. https://admin.fedoraproject.org/updates/docker-io-0.7.0-14.el6
docker-io-0.7.0-14.el6 has been pushed to the Fedora EPEL 6 stable repository. If problems still persist, please make note of it in this bug report.
docker-io-0.7.0-14.fc19 has been pushed to the Fedora 19 stable repository. If problems still persist, please make note of it in this bug report.
docker-io-0.7.0-14.fc20 has been pushed to the Fedora 20 stable repository. If problems still persist, please make note of it in this bug report.