Bug 1026545 - dockerinit fails with "libdevmapper.so.1.02: cannot open shared object file"
Summary: dockerinit fails with "libdevmapper.so.1.02: cannot open shared object file"
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: docker-io
Version: 19
Hardware: x86_64
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Vincent Batts
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 1028670 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-11-04 22:52 UTC by Seth Jennings
Modified: 2013-12-14 02:47 UTC (History)
19 users (show)

Fixed In Version: docker-io-0.7.0-14.fc20
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-11-25 17:48:02 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
dockerinit build process fix (1.29 KB, patch)
2013-11-25 01:52 UTC, dan-fedora
no flags Details | Diff

Description Seth Jennings 2013-11-04 22:52:17 UTC
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

Comment 1 Seth Jennings 2013-11-04 22:54:22 UTC
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)

Comment 2 Josh Poimboeuf 2013-11-04 23:01:15 UTC
Also related: bug 1017186 (can't compile dockerinit statically with go 1.1)

Comment 3 Josh Poimboeuf 2013-11-04 23:02:46 UTC
Alex, can you comment on why docker-init requires libdevmapper?  Is it for Docker-in-Docker?

Comment 4 Lokesh Mandvekar 2013-11-05 04:11:39 UTC
just throwing it out there: this also occurs with centos and busybox containers

Comment 5 Alexander Larsson 2013-11-06 09:13:18 UTC
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.

Comment 6 Matthew Miller 2013-11-09 14:22:34 UTC
*** Bug 1028670 has been marked as a duplicate of this bug. ***

Comment 7 Raphaël Davaillaud 2013-11-12 13:26:55 UTC
This occurs with the official centos 6 image, but not with quagbrain/centos5.9 image.

Comment 8 Tianon Gravi 2013-11-13 15:05:15 UTC
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.

Comment 9 Lokesh Mandvekar 2013-11-19 21:25:27 UTC
0.7-rc5 has been submitted to rawhide by vbatts

Comment 10 Dave Lawrence 2013-11-21 04:42:45 UTC
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

Comment 11 Marek Goldmann 2013-11-21 07:38:41 UTC
(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.

Comment 12 Marek Goldmann 2013-11-21 07:40:08 UTC
Ignore my previous comment :)

Comment 13 Marek Goldmann 2013-11-21 08:28:53 UTC
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.

Comment 14 Marek Goldmann 2013-11-21 08:30:08 UTC
Forgot to mention that I use docker-io-0.7-0.13.dm.fc20.x86_64.

P.S. Sorry for the spam.

Comment 15 Vincent Batts 2013-11-21 14:18:51 UTC
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.

Comment 16 Dave Lawrence 2013-11-21 15:11:24 UTC
(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

Comment 17 Dave Lawrence 2013-11-21 15:16:41 UTC
(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

Comment 18 Michael Young 2013-11-22 19:10:34 UTC
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 .

Comment 19 dan-fedora 2013-11-25 01:52:05 UTC
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)

Comment 20 Dave Lawrence 2013-11-25 04:08:09 UTC
(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

Comment 21 Marek Goldmann 2013-11-25 12:47:07 UTC
+1 This patch fixes the issue for me too.

Comment 22 Vincent Batts 2013-11-25 12:58:56 UTC
cool. I'm working it through the dists, and will push it out shortly.

Comment 23 Fedora Update System 2013-11-25 13:41:01 UTC
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

Comment 24 Viacheslav Dubrovskiy 2013-11-25 13:41:54 UTC
+1 Yes it helped.

Comment 25 Fedora Update System 2013-11-25 13:42:11 UTC
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

Comment 26 Fedora Update System 2013-11-25 13:43:25 UTC
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

Comment 27 Fedora Update System 2013-11-27 18:09:00 UTC
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

Comment 28 Fedora Update System 2013-11-28 07:03:45 UTC
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

Comment 29 Fedora Update System 2013-11-28 07:14:04 UTC
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

Comment 30 Fedora Update System 2013-11-28 09:12:56 UTC
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

Comment 31 Fedora Update System 2013-11-28 09:24:09 UTC
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

Comment 32 Fedora Update System 2013-11-28 09:42:31 UTC
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

Comment 33 Fedora Update System 2013-11-28 18:28:33 UTC
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

Comment 34 Fedora Update System 2013-11-28 18:36:38 UTC
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

Comment 35 Fedora Update System 2013-11-28 18:44:26 UTC
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

Comment 36 Fedora Update System 2013-12-01 19:33:40 UTC
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

Comment 37 Fedora Update System 2013-12-02 02:45:24 UTC
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

Comment 38 Fedora Update System 2013-12-02 04:59:14 UTC
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

Comment 39 Fedora Update System 2013-12-02 16:00:54 UTC
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

Comment 40 Fedora Update System 2013-12-02 16:17:07 UTC
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

Comment 41 Fedora Update System 2013-12-02 16:28:32 UTC
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

Comment 42 Fedora Update System 2013-12-03 01:20:25 UTC
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.

Comment 43 Fedora Update System 2013-12-03 10:38:42 UTC
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.

Comment 44 Fedora Update System 2013-12-14 02:47:30 UTC
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.


Note You need to log in before you can comment on or make changes to this bug.