SHA256
1
0
forked from pool/docker

- 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.

OBS-URL: https://build.opensuse.org/package/show/Virtualization:containers/docker?expand=0&rev=9
This commit is contained in:
Flavio Castelli 2015-06-05 15:24:58 +00:00 committed by Git OBS Bridge
parent bc3232817c
commit 5a40d680c1
5 changed files with 84 additions and 1 deletions

View File

@ -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

View File

@ -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

View File

@ -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 "

View File

@ -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())

10
sysconfig.docker.ppc64le Normal file
View File

@ -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 "