diff --git a/docker.changes b/docker.changes index fd80cef..99f24b6 100644 --- a/docker.changes +++ b/docker.changes @@ -1,3 +1,14 @@ +------------------------------------------------------------------- +Fri Jun 5 15:23:47 UTC 2015 - fcastelli@suse.com + +- Build docker on PPC and S390x using gcc-go provided by gcc5 + * added sysconfig.docker.ppc64le: make docker daemon start on ppc64le + despite some iptables issues. To be removed soon + * ignore-dockerinit-checksum.patch: applied only when building with + gcc-go. Required to workaround a limitation of gcc-go + * gcc-go-build-static-libgo.patch: used only when building with gcc-go, + link libgo statically into docker itself. + ------------------------------------------------------------------- Wed May 27 10:02:51 UTC 2015 - dmacvicar@suse.de diff --git a/docker.spec b/docker.spec index 75fb827..d4009b5 100644 --- a/docker.spec +++ b/docker.spec @@ -37,13 +37,25 @@ Source5: docker_systemd_lt_214.socket Source6: docker-rpmlintrc Source7: README_SUSE.md +# TODO: remove once we figure out what is wrong with iptables on ppc64le +Source100: sysconfig.docker.ppc64le Patch0: 0002-Stripped-dockerinit-binary.patch # PATCH-FIX-OPENSUSE libcontainer-apparmor-fixes.patch -- mount rules aren't supported in our apparmor Patch1: libcontainer-apparmor-fixes.patch +# Required to overcome some limitations of gcc-go: https://groups.google.com/forum/#!msg/golang-nuts/SlGCPYkjxo4/4DjcjXRCqAkJ +# Right now docker passes the sha1sum of the dockerinit binary to the docker binary at build time +# We cannot do that, right now a quick and really dirty way to get it running is +# to simply disable this check +Patch100: ignore-dockerinit-checksum.patch +Patch101: gcc-go-build-static-libgo.patch BuildRequires: bash-completion BuildRequires: device-mapper-devel >= 1.2.68 BuildRequires: glibc-devel-static +%ifarch ppc ppc64 s390x ppc64p7 ppc64l +BuildRequires: gcc5-go >= 5.0 +%else BuildRequires: go >= 1.3 +%endif BuildRequires: go-go-md2man BuildRequires: libapparmor-devel BuildRequires: libbtrfs-devel >= 3.8 @@ -67,7 +79,6 @@ Requires: xz >= 4.9 Conflicts: lxc < 1.0 PreReq: %fillup_prereq BuildRoot: %{_tmppath}/%{name}-%{version}-build -ExclusiveArch: armv7hl x86_64 %description Docker complements LXC with a high-level API which operates at the process @@ -102,9 +113,19 @@ Zsh command line completion support for %{name}. %setup -q -n docker %patch0 -p1 %patch1 -p1 +%ifarch ppc ppc64 s390x ppc64p7 ppc64l +%patch100 -p1 +%patch101 -p1 +%endif cp %{SOURCE7} . %build +%ifarch ppc ppc64 s390x ppc64p7 ppc64l +mkdir /tmp/dirty-hack +ln -s /usr/bin/go-5 /tmp/dirty-hack/go +export PATH=/tmp/dirty-hack:$PATH +%endif + export AUTO_GOPATH=1 export DOCKER_BUILDTAGS="exclude_graphdriver_aufs apparmor selinux" export DOCKER_GITCOMMIT=%{git_version} @@ -139,7 +160,11 @@ ln -sf /sbin/service $RPM_BUILD_ROOT/usr/sbin/rcdocker install -D -m 0644 %SOURCE3 %{buildroot}%{_prefix}/lib/udev/rules.d/80-%{name}.rules # sysconfig file +%ifarch ppc64le +install -D -m 644 %SOURCE100 %{buildroot}/var/adm/fillup-templates/sysconfig.docker +%else install -D -m 644 %SOURCE4 %{buildroot}/var/adm/fillup-templates/sysconfig.docker +%endif # install manpages install -d %{buildroot}%{_mandir}/man1 diff --git a/gcc-go-build-static-libgo.patch b/gcc-go-build-static-libgo.patch new file mode 100644 index 0000000..888799f --- /dev/null +++ b/gcc-go-build-static-libgo.patch @@ -0,0 +1,24 @@ +Index: docker/project/make/.dockerinit +=================================================================== +--- docker.orig/project/make/.dockerinit ++++ docker/project/make/.dockerinit +@@ -3,6 +3,7 @@ set -e + + # dockerinit still needs to be a static binary, even if docker is dynamic + go build \ ++ -gccgoflags="-static-libgo" \ + -o "$DEST/dockerinit-$VERSION" \ + "${BUILDFLAGS[@]}" \ + -ldflags " +Index: docker/project/make/binary +=================================================================== +--- docker.orig/project/make/binary ++++ docker/project/make/binary +@@ -12,6 +12,7 @@ if [[ "$(uname -s)" == CYGWIN* ]]; then + fi + + go build \ ++ -gccgoflags="-static-libgo" \ + -o "$DEST/$BINARY_FULLNAME" \ + "${BUILDFLAGS[@]}" \ + -ldflags " diff --git a/ignore-dockerinit-checksum.patch b/ignore-dockerinit-checksum.patch new file mode 100644 index 0000000..e9d7d1b --- /dev/null +++ b/ignore-dockerinit-checksum.patch @@ -0,0 +1,13 @@ +Index: docker/utils/utils.go +=================================================================== +--- docker.orig/utils/utils.go ++++ docker/utils/utils.go +@@ -111,7 +111,7 @@ func isValidDockerInitPath(target string + } + return os.SameFile(targetFileInfo, selfPathFileInfo) + } +- return dockerversion.INITSHA1 != "" && dockerInitSha1(target) == dockerversion.INITSHA1 ++ return true + } + + // Figure out the path of our dockerinit (which may be SelfPath()) diff --git a/sysconfig.docker.ppc64le b/sysconfig.docker.ppc64le new file mode 100644 index 0000000..d963e0c --- /dev/null +++ b/sysconfig.docker.ppc64le @@ -0,0 +1,10 @@ + +## Path : System/Management +## Description : Extra cli switches for docker daemon +## Type : string +## Default : "" +## ServiceRestart : docker +# + +# TODO: remove it once we fix the real issue +DOCKER_OPTS=" -iptables=false "