Build issue while packaging docker for openSUSE

205 views
Skip to first unread message

Flavio Castelli

unread,
Nov 27, 2013, 3:44:26 AM11/27/13
to docke...@googlegroups.com
Hello, I'm the docker's maintainer for openSUSE. While upgrading to 0.7.0 I decided to fix the build process used at packaging time (in the past I didn't use hack/make.sh binary, shame on me :).

I'm building docker using the intree dependencies shipped inside of 'vendor'. The build process takes place on a x86_64 machine which has go 1.2rc2 installed.

This is the output produced during build time (I've added "set -x" to make.sh to have more debugging information):

[   31s] + cd /home/abuild/rpmbuild/BUILD
[   31s] + /usr/bin/rm -rf /home/abuild/rpmbuild/BUILDROOT/docker-0.7.0-0.x86_64
[   31s] ++ dirname /home/abuild/rpmbuild/BUILDROOT/docker-0.7.0-0.x86_64
[   31s] + /usr/bin/mkdir -p /home/abuild/rpmbuild/BUILDROOT
[   31s] + /usr/bin/mkdir /home/abuild/rpmbuild/BUILDROOT/docker-0.7.0-0.x86_64
[   31s] + cd docker
[   31s] ++ pwd
[   31s] + export GOPATH=/home/abuild/go:/usr/lib64/go/contrib:/home/abuild/rpmbuild/BUILD/docker/vendor
[   31s] + GOPATH=/home/abuild/go:/usr/lib64/go/contrib:/home/abuild/rpmbuild/BUILD/docker/vendor
[   31s] ++ pwd
[   31s] + ln -s /home/abuild/rpmbuild/BUILD/docker vendor/src/github.com/dotcloud/
[   31s] + export CGO_ENABLED=0
[   31s] + CGO_ENABLED=0
[   31s] + export DOCKER_GITCOMMIT=0d078b6
[   31s] + DOCKER_GITCOMMIT=0d078b6
[   31s] + ./hack/make.sh binary
[   31s] + set -o pipefail
[   31s] ++ readlink --canonicalize /etc/resolv.conf
[   31s] + RESOLVCONF=/etc/resolv.conf
[   31s] + grep -q /etc/resolv.conf /proc/mounts
[   31s] + echo '# WARNING! I don'\''t seem to be running in a docker container.'
[   31s] # WARNING! I don't seem to be running in a docker container.
[   31s] + echo '# The result of this command might be an incorrect build, and will not be officially supported.'
[   31s] # The result of this command might be an incorrect build, and will not be officially supported.
[   31s] + echo '# Try this: '\''docker build -t docker . && docker run docker ./hack/make.sh'\'''
[   31s] # Try this: 'docker build -t docker . && docker run docker ./hack/make.sh'
[   31s] + DEFAULT_BUNDLES=(binary test dynbinary dyntest tgz ubuntu)
[   31s] ++ cat ./VERSION
[   31s] + VERSION=0.7.0
[   31s] + '[' -d .git ']'
[   31s] + '[' 0d078b6 ']'
[   31s] + GITCOMMIT=0d078b6
[   31s] + LDFLAGS='-X main.GITCOMMIT "0d078b6" -X main.VERSION "0.7.0" -w'
[   31s] + LDFLAGS_STATIC='-X github.com/dotcloud/docker/utils.IAMSTATIC true -linkmode external -extldflags "-lpthread -static -Wl,--unresolved-symbols=ignore-in-object-files"'
[   31s] + BUILDFLAGS='-tags netgo'
[   31s] + main binary
[   31s] + mkdir -p bundles
[   31s] + '[' -e bundles/0.7.0 ']'
[   31s] +++ dirname ./hack/make.sh
[   31s] ++ cd ./hack
[   31s] ++ pwd
[   31s] + SCRIPTDIR=/home/abuild/rpmbuild/BUILD/docker/hack
[   31s] + '[' 1 -lt 1 ']'
[   31s] + bundles=($@)
[   31s] + for bundle in '${bundles[@]}'
[   31s] + bundle /home/abuild/rpmbuild/BUILD/docker/hack/make/binary
[   31s] + bundlescript=/home/abuild/rpmbuild/BUILD/docker/hack/make/binary
[   31s] ++ basename /home/abuild/rpmbuild/BUILD/docker/hack/make/binary
[   31s] + bundle=binary
[   31s] + echo '---> Making bundle: binary (in bundles/0.7.0/binary)'
[   31s] ---> Making bundle: binary (in bundles/0.7.0/binary)
[   31s] + mkdir -p bundles/0.7.0/binary
[   31s] ++ pwd
[   31s] + source /home/abuild/rpmbuild/BUILD/docker/hack/make/binary /home/abuild/rpmbuild/BUILD/docker/bundles/0.7.0/binary
[   31s] ++ DEST=/home/abuild/rpmbuild/BUILD/docker/bundles/0.7.0/binary
[   31s] ++ go build -o /home/abuild/rpmbuild/BUILD/docker/bundles/0.7.0/binary/docker-0.7.0 -ldflags '-X main.GITCOMMIT "0d078b6" -X main.VERSION "0.7.0" -w -X github.com/dotcloud/docker/utils.IAMSTATIC true -linkmode external -extldflags "-lpthread -static -Wl,--unresolved-symbols=ignore-in-object-files"' -tags netgo ./docker
[   32s] vendor/src/github.com/dotcloud/docker/runtime.go:4:2: no buildable Go source files in /home/abuild/rpmbuild/BUILD/docker/vendor/src/code.google.com/p/gosqlite/sqlite3
[   32s] error: Bad exit status from /var/tmp/rpm-tmp.n0VYbW (%build)


As you can see the build fails because there are "no buildable Go source files in /home/abuild/rpmbuild/BUILD/docker/vendor/src/code.google.com/p/gosqlite/sqlite3". This directory contains the 'driver.go' file, which looks perfectly fine to me.

Do you know what is going wrong?

Thanks in advance
Flavio

Flavio Castelli

unread,
Nov 28, 2013, 5:25:10 AM11/28/13
to docke...@googlegroups.com
On 11/27/2013 09:44 AM, Flavio Castelli wrote:
> Do you know what is going wrong?

I managed to fix the issue by building a dynbinary via make.sh.

That's nice, but I'm still interested in knowing what is going wrong
with the static binary build. Ping me if you have any idea :)

Cheers
Flavio

Tianon

unread,
Nov 28, 2013, 11:15:53 PM11/28/13
to docke...@googlegroups.com
Hi Flavio!  Thanks for switching to using our build script - we really appreciate that.  As you've discovered, the "dynbinary" bundlescript was created specifically for packagers, since getting the completely-static monolithic binary to compile correctly in a normal "packaging" environment can be quite a challenge (even in places like Gentoo)!

If I had to guess what was wrong with your static build before, I would guess that you didn't have a static copy of libsqlite3.  You'd also need a static copy of libdevmapper (which is more difficult to come by reasonably than sqlite3 is).
Reply all
Reply to author
Forward
0 new messages