From 5a40d680c11875997c6c083e6b1a6006929c680b78e7fdef295e4949225803c2 Mon Sep 17 00:00:00 2001 From: Flavio Castelli Date: Fri, 5 Jun 2015 15:24:58 +0000 Subject: [PATCH 1/9] - 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 --- docker.changes | 11 +++++++++++ docker.spec | 27 ++++++++++++++++++++++++++- gcc-go-build-static-libgo.patch | 24 ++++++++++++++++++++++++ ignore-dockerinit-checksum.patch | 13 +++++++++++++ sysconfig.docker.ppc64le | 10 ++++++++++ 5 files changed, 84 insertions(+), 1 deletion(-) create mode 100644 gcc-go-build-static-libgo.patch create mode 100644 ignore-dockerinit-checksum.patch create mode 100644 sysconfig.docker.ppc64le 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 " From 9017ee55c3a6d7e030b60ab673ecaae17c432d42db02899df0d4951b01233b52 Mon Sep 17 00:00:00 2001 From: Flavio Castelli Date: Fri, 5 Jun 2015 15:27:32 +0000 Subject: [PATCH 2/9] - Fixed ppc64le name inside of spec file OBS-URL: https://build.opensuse.org/package/show/Virtualization:containers/docker?expand=0&rev=10 --- docker.changes | 5 +++++ docker.spec | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/docker.changes b/docker.changes index 99f24b6..c1cd492 100644 --- a/docker.changes +++ b/docker.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Fri Jun 5 15:29:45 UTC 2015 - fcastelli@suse.com + +- Fixed ppc64le name inside of spec file + ------------------------------------------------------------------- Fri Jun 5 15:23:47 UTC 2015 - fcastelli@suse.com diff --git a/docker.spec b/docker.spec index d4009b5..ec35ab6 100644 --- a/docker.spec +++ b/docker.spec @@ -51,7 +51,7 @@ 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 +%ifarch ppc ppc64 s390x ppc64p7 ppc64le BuildRequires: gcc5-go >= 5.0 %else BuildRequires: go >= 1.3 @@ -113,14 +113,14 @@ Zsh command line completion support for %{name}. %setup -q -n docker %patch0 -p1 %patch1 -p1 -%ifarch ppc ppc64 s390x ppc64p7 ppc64l +%ifarch ppc ppc64 s390x ppc64p7 ppc64le %patch100 -p1 %patch101 -p1 %endif cp %{SOURCE7} . %build -%ifarch ppc ppc64 s390x ppc64p7 ppc64l +%ifarch ppc ppc64 s390x ppc64p7 ppc64le mkdir /tmp/dirty-hack ln -s /usr/bin/go-5 /tmp/dirty-hack/go export PATH=/tmp/dirty-hack:$PATH From 84f28f19efb965147db0dd2f0767ace406b30b0d4333839323a92ee4a792bb49 Mon Sep 17 00:00:00 2001 From: Flavio Castelli Date: Wed, 10 Jun 2015 08:16:24 +0000 Subject: [PATCH 3/9] Accepting request 311406 from home:jordimassaguerpla:branches:Virtualization:containers Remove unneeded dependencies: * go-go-md2man: this is required to build the man pages. * systemd-devel: this was a build time dependency required to have some directories inside of the build root Exclude the whole "/usr/src/docker/bundles" directory from the final package. OBS-URL: https://build.opensuse.org/request/show/311406 OBS-URL: https://build.opensuse.org/package/show/Virtualization:containers/docker?expand=0&rev=11 --- 0002-Stripped-dockerinit-binary.patch | 2 +- docker-rpmlintrc | 8 ++++++ docker.changes | 5 ++++ docker.spec | 41 +++++++++++++++++++++++++++ ignore-dockerinit-checksum.patch | 2 +- 5 files changed, 56 insertions(+), 2 deletions(-) diff --git a/0002-Stripped-dockerinit-binary.patch b/0002-Stripped-dockerinit-binary.patch index 89e472c..aefec65 100644 --- a/0002-Stripped-dockerinit-binary.patch +++ b/0002-Stripped-dockerinit-binary.patch @@ -19,7 +19,7 @@ Index: docker/hack/make/.dockerinit =================================================================== --- docker.orig/hack/make/.dockerinit +++ docker/hack/make/.dockerinit -@@ -25,5 +25,7 @@ else +@@ -29,5 +29,7 @@ exit 1 fi diff --git a/docker-rpmlintrc b/docker-rpmlintrc index 00c5581..3d6adae 100644 --- a/docker-rpmlintrc +++ b/docker-rpmlintrc @@ -4,3 +4,11 @@ addFilter ("^docker.x86_64: W: statically-linked-binary /usr/lib/docker/dockerin addFilter ("^docker.x86_64: W: unstripped-binary-or-object /usr/lib/docker/dockerinit") addFilter ("^docker.x86_64: W: no-manual-page-for-binary docker") addFilter ("^docker.x86_64: W: no-manual-page-for-binary nsinit") +addFilter ("test.noarch.*: E: devel-file-in-non-devel-package") +addFilter ("test.noarch.*: W: pem-certificate") +addFilter ("test.noarch.*: W: non-executable-script") +addFilter ("test.noarch.*: W: hidden-file-or-dir") +addFilter ("test.noarch.*: W: files-duplicate") +addFilter ("test.noarch.*: W: script-without-shebang /usr/src/docker/docs/README.md") +addFilter ("test.noarch.*: W: sourced-script-with-shebang /etc/bash_completion.d/docker bash") +addFilter ("test.noarch.*: W: suse-filelist-forbidden-fhs23 /usr/src/docker") diff --git a/docker.changes b/docker.changes index c1cd492..7c302cf 100644 --- a/docker.changes +++ b/docker.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Jun 9 16:35:46 UTC 2015 - jmassaguerpla@suse.com + +- Add test subpackage and fix line numbers in patches + ------------------------------------------------------------------- Fri Jun 5 15:29:45 UTC 2015 - fcastelli@suse.com diff --git a/docker.spec b/docker.spec index ec35ab6..2986080 100644 --- a/docker.spec +++ b/docker.spec @@ -109,6 +109,27 @@ BuildArch: noarch %description zsh-completion Zsh command line completion support for %{name}. +%package test +Summary: Test package for docker +Group: System/Management +Requires: device-mapper-devel >= 1.2.68 +Requires: glibc-devel-static +%ifarch ppc ppc64 s390x ppc64p7 ppc64le +Requires: gcc5-go >= 5.0 +%else +Requires: go >= 1.3 +%endif +Requires: apparmor-parser +Requires: bash-completion +Requires: libapparmor-devel +Requires: libbtrfs-devel >= 3.8 +Requires: procps +Requires: sqlite3-devel +BuildArch: noarch + +%description test +Test package for docker. It contains the source code and the tests. + %prep %setup -q -n docker %patch0 -p1 @@ -126,11 +147,23 @@ ln -s /usr/bin/go-5 /tmp/dirty-hack/go export PATH=/tmp/dirty-hack:$PATH %endif +(cat < docker_build_env +. ./docker_build_env ./hack/make.sh dynbinary docs/man/md2man-all.sh +# remove git files +find . -name ".gitignore" | xargs rm +# remove other than systemd +# otherwise the resulting package will have extra requires +rm -rf contrib/init/openrc +rm -rf contrib/init/sysvinit-debian +rm -rf contrib/init/sysvinit-redhat +rm -rf contrib/init/upstart %install install -d %{buildroot}%{go_contribdir} @@ -144,6 +177,9 @@ install -Dd -m 0755 \ install -D -m0644 contrib/completion/bash/docker "%{buildroot}/etc/bash_completion.d/%{name}" install -D -m0644 contrib/completion/zsh/_docker "%{buildroot}/etc/zsh_completion.d/%{name}" +# copy all for the test package +install -d %{buildroot}/usr/src/docker/ +cp -av . %{buildroot}/usr/src/docker/ # # systemd service @@ -210,4 +246,9 @@ groupadd -r docker 2>/dev/null || : %defattr(-,root,root) %config %{_sysconfdir}/zsh_completion.d/%{name} +%files test +%defattr(-,root,root) +/usr/src/docker/ +%exclude /usr/src/docker/bundles/ + %changelog diff --git a/ignore-dockerinit-checksum.patch b/ignore-dockerinit-checksum.patch index e9d7d1b..2f33404 100644 --- a/ignore-dockerinit-checksum.patch +++ b/ignore-dockerinit-checksum.patch @@ -2,7 +2,7 @@ Index: docker/utils/utils.go =================================================================== --- docker.orig/utils/utils.go +++ docker/utils/utils.go -@@ -111,7 +111,7 @@ func isValidDockerInitPath(target string +@@ -110,7 +110,7 @@ } return os.SameFile(targetFileInfo, selfPathFileInfo) } From a2023564fb4af5473e12f73ee64a72c415d7e69e160b8658faeacc295e94253b Mon Sep 17 00:00:00 2001 From: Flavio Castelli Date: Mon, 22 Jun 2015 09:09:23 +0000 Subject: [PATCH 4/9] =?UTF-8?q?-=20Updated=20to=201.7.0=20(2015-06-16)=20-?= =?UTF-8?q?=20bnc#935570=20=20=20*=20Runtime=20=20=20=20=20-=20Experimenta?= =?UTF-8?q?l=20feature:=20support=20for=20out-of-process=20volume=20plugin?= =?UTF-8?q?s=20=20=20=20=20-=20The=20userland=20proxy=20can=20be=20disable?= =?UTF-8?q?d=20in=20favor=20of=20hairpin=20NAT=20using=20the=20daemon?= =?UTF-8?q?=E2=80=99s=20`--userland-proxy=3Dfalse`=20flag=20=20=20=20=20-?= =?UTF-8?q?=20The=20`exec`=20command=20supports=20the=20`-u|--user`=20flag?= =?UTF-8?q?=20to=20specify=20the=20new=20process=20owner=20=20=20=20=20-?= =?UTF-8?q?=20Default=20gateway=20for=20containers=20can=20be=20specified?= =?UTF-8?q?=20daemon-wide=20using=20the=20`--default-gateway`=20and=20`--d?= =?UTF-8?q?efault-gateway-v6`=20flags=20=20=20=20=20-=20The=20CPU=20CFS=20?= =?UTF-8?q?(Completely=20Fair=20Scheduler)=20quota=20can=20be=20set=20in?= =?UTF-8?q?=20`docker=20run`=20using=20`--cpu-quota`=20=20=20=20=20-=20Con?= =?UTF-8?q?tainer=20block=20IO=20can=20be=20controlled=20in=20`docker=20ru?= =?UTF-8?q?n`=20using`--blkio-weight`=20=20=20=20=20-=20ZFS=20support=20?= =?UTF-8?q?=20=20=20=20-=20The=20`docker=20logs`=20command=20supports=20a?= =?UTF-8?q?=20`--since`=20argument=20=20=20=20=20-=20UTS=20namespace=20can?= =?UTF-8?q?=20be=20shared=20with=20the=20host=20with=20`docker=20run=20--u?= =?UTF-8?q?ts=3Dhost`=20=20=20*=20Quality=20=20=20=20=20-=20Networking=20s?= =?UTF-8?q?tack=20was=20entirely=20rewritten=20as=20part=20of=20the=20libn?= =?UTF-8?q?etwork=20effort=20=20=20=20=20-=20Engine=20internals=20refactor?= =?UTF-8?q?ing=20=20=20=20=20-=20Volumes=20code=20was=20entirely=20rewritt?= =?UTF-8?q?en=20to=20support=20the=20plugins=20effort=20=20=20=20=20-=20Se?= =?UTF-8?q?nding=20SIGUSR1=20to=20a=20daemon=20will=20dump=20all=20gorouti?= =?UTF-8?q?nes=20stacks=20without=20exiting=20=20=20*=20Build=20=20=20=20?= =?UTF-8?q?=20-=20Support=20${variable:-value}=20and=20${variable:+value}?= =?UTF-8?q?=20syntax=20for=20environment=20variables=20=20=20=20=20-=20Sup?= =?UTF-8?q?port=20resource=20management=20flags=20`--cgroup-parent`,=20`--?= =?UTF-8?q?cpu-period`,=20`--cpu-quota`,=20`--cpuset-cpus`,=20`--cpuset-me?= =?UTF-8?q?ms`=20=20=20=20=20-=20git=20context=20changes=20with=20branches?= =?UTF-8?q?=20and=20directories=20=20=20=20=20-=20The=20.dockerignore=20fi?= =?UTF-8?q?le=20support=20exclusion=20rules=20=20=20*=20Distribution=20=20?= =?UTF-8?q?=20=20=20-=20Client=20support=20for=20v2=20mirroring=20support?= =?UTF-8?q?=20for=20the=20official=20registry=20=20=20*=20Bugfixes=20=20?= =?UTF-8?q?=20=20=20-=20Firewalld=20is=20now=20supported=20and=20will=20au?= =?UTF-8?q?tomatically=20be=20used=20when=20available=20=20=20=20=20-=20mo?= =?UTF-8?q?unting=20--device=20recursively=20-=20Patch=200002-Stripped-doc?= =?UTF-8?q?kerinit-binary.patch=20renamed=20to=20fix-docker-init.patch=20?= =?UTF-8?q?=20=20and=20fixed=20to=20build=20with=20latest=20version=20of?= =?UTF-8?q?=20docker?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit OBS-URL: https://build.opensuse.org/package/show/Virtualization:containers/docker?expand=0&rev=12 --- 0002-Stripped-dockerinit-binary.patch | 29 ------------------------ docker-1.6.2.tar.bz2 | 3 --- docker-1.7.0.tar.bz2 | 3 +++ docker.changes | 32 +++++++++++++++++++++++++++ docker.spec | 22 ++++++++---------- fix-docker-init.patch | 12 ++++++++++ 6 files changed, 56 insertions(+), 45 deletions(-) delete mode 100644 0002-Stripped-dockerinit-binary.patch delete mode 100644 docker-1.6.2.tar.bz2 create mode 100644 docker-1.7.0.tar.bz2 create mode 100644 fix-docker-init.patch diff --git a/0002-Stripped-dockerinit-binary.patch b/0002-Stripped-dockerinit-binary.patch deleted file mode 100644 index aefec65..0000000 --- a/0002-Stripped-dockerinit-binary.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 86a768c5a830220024a56495f18e88bfc21f3aac Mon Sep 17 00:00:00 2001 -From: Flavio Castelli -Date: Wed, 26 Mar 2014 17:50:19 +0100 -Subject: [PATCH 2/2] Stripped dockerinit binary - -The sha1sum of `dockerinit` is hardcoded into `docker` binary and is -checked at runtime. OBS strips the debugging symbols from all the -binaries (and hence also from `dockerinit`). That causes the sha1sum of -the installed file to be different from the value computed inside of the -buildroot. - -This commit strips the debugging symbols from `dockerinit` _before_ the -`docker` binary is built. Avoiding all the runtime errors. ---- - hack/make/dynbinary | 1 + - 1 file changed, 1 insertion(+) - -Index: docker/hack/make/.dockerinit -=================================================================== ---- docker.orig/hack/make/.dockerinit -+++ docker/hack/make/.dockerinit -@@ -29,5 +29,7 @@ - exit 1 - fi - -+/usr/bin/strip -s $DEST/dockerinit-$VERSION -+ - # sha1 our new dockerinit to ensure separate docker and dockerinit always run in a perfect pair compiled for one another - export DOCKER_INITSHA1="$($sha1sum $DEST/dockerinit-$VERSION | cut -d' ' -f1)" diff --git a/docker-1.6.2.tar.bz2 b/docker-1.6.2.tar.bz2 deleted file mode 100644 index a0e97ff..0000000 --- a/docker-1.6.2.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d819c93af2c7dd7ad75d24df5ea525efe2abac8ff23c0a9667796dedd21c8f9f -size 5480404 diff --git a/docker-1.7.0.tar.bz2 b/docker-1.7.0.tar.bz2 new file mode 100644 index 0000000..35b0f11 --- /dev/null +++ b/docker-1.7.0.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:760807f5c0a28f5262006704d2c682733bf7cddc4bfb1464f7b7eb88c84cb9a6 +size 6524566 diff --git a/docker.changes b/docker.changes index 7c302cf..408e374 100644 --- a/docker.changes +++ b/docker.changes @@ -1,3 +1,35 @@ +------------------------------------------------------------------- +Mon Jun 22 08:48:11 UTC 2015 - fcastelli@suse.com + +- Updated to 1.7.0 (2015-06-16) - bnc#935570 + * Runtime + - Experimental feature: support for out-of-process volume plugins + - The userland proxy can be disabled in favor of hairpin NAT using the daemon’s `--userland-proxy=false` flag + - The `exec` command supports the `-u|--user` flag to specify the new process owner + - Default gateway for containers can be specified daemon-wide using the `--default-gateway` and `--default-gateway-v6` flags + - The CPU CFS (Completely Fair Scheduler) quota can be set in `docker run` using `--cpu-quota` + - Container block IO can be controlled in `docker run` using`--blkio-weight` + - ZFS support + - The `docker logs` command supports a `--since` argument + - UTS namespace can be shared with the host with `docker run --uts=host` + * Quality + - Networking stack was entirely rewritten as part of the libnetwork effort + - Engine internals refactoring + - Volumes code was entirely rewritten to support the plugins effort + - Sending SIGUSR1 to a daemon will dump all goroutines stacks without exiting + * Build + - Support ${variable:-value} and ${variable:+value} syntax for environment variables + - Support resource management flags `--cgroup-parent`, `--cpu-period`, `--cpu-quota`, `--cpuset-cpus`, `--cpuset-mems` + - git context changes with branches and directories + - The .dockerignore file support exclusion rules + * Distribution + - Client support for v2 mirroring support for the official registry + * Bugfixes + - Firewalld is now supported and will automatically be used when available + - mounting --device recursively +- Patch 0002-Stripped-dockerinit-binary.patch renamed to fix-docker-init.patch + and fixed to build with latest version of docker + ------------------------------------------------------------------- Tue Jun 9 16:35:46 UTC 2015 - jmassaguerpla@suse.com diff --git a/docker.spec b/docker.spec index 2986080..e417064 100644 --- a/docker.spec +++ b/docker.spec @@ -16,9 +16,9 @@ # -%define git_version 7c8fca2 +%define git_version 0baf609 Name: docker -Version: 1.6.2 +Version: 1.7.0 Release: 0 Summary: The Linux container runtime License: Apache-2.0 @@ -39,7 +39,7 @@ 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 +Patch0: fix-docker-init.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 @@ -54,7 +54,7 @@ BuildRequires: glibc-devel-static %ifarch ppc ppc64 s390x ppc64p7 ppc64le BuildRequires: gcc5-go >= 5.0 %else -BuildRequires: go >= 1.3 +BuildRequires: go >= 1.4 %endif BuildRequires: go-go-md2man BuildRequires: libapparmor-devel @@ -139,6 +139,7 @@ Test package for docker. It contains the source code and the tests. %patch101 -p1 %endif cp %{SOURCE7} . +find . -name ".gitignore" | xargs rm %build %ifarch ppc ppc64 s390x ppc64p7 ppc64le @@ -155,15 +156,10 @@ EOF ) > docker_build_env . ./docker_build_env ./hack/make.sh dynbinary -docs/man/md2man-all.sh -# remove git files -find . -name ".gitignore" | xargs rm +man/md2man-all.sh # remove other than systemd # otherwise the resulting package will have extra requires -rm -rf contrib/init/openrc -rm -rf contrib/init/sysvinit-debian -rm -rf contrib/init/sysvinit-redhat -rm -rf contrib/init/upstart +rm -rf hack/make/.build-deb %install install -d %{buildroot}%{go_contribdir} @@ -204,9 +200,9 @@ install -D -m 644 %SOURCE4 %{buildroot}/var/adm/fillup-templates/sysconfig.docke # install manpages install -d %{buildroot}%{_mandir}/man1 -install -p -m 644 docs/man/man1/*.1 %{buildroot}%{_mandir}/man1 +install -p -m 644 man/man1/*.1 %{buildroot}%{_mandir}/man1 install -d %{buildroot}%{_mandir}/man5 -install -p -m 644 docs/man/man5/Dockerfile.5 %{buildroot}%{_mandir}/man5 +install -p -m 644 man/man5/Dockerfile.5 %{buildroot}%{_mandir}/man5 %pre echo "creating group docker..." diff --git a/fix-docker-init.patch b/fix-docker-init.patch new file mode 100644 index 0000000..fe5d25a --- /dev/null +++ b/fix-docker-init.patch @@ -0,0 +1,12 @@ +Index: docker/hack/make/.dockerinit +=================================================================== +--- docker.orig/hack/make/.dockerinit ++++ docker/hack/make/.dockerinit +@@ -29,5 +29,7 @@ else + exit 1 + fi + ++/usr/bin/strip -s $DEST/dockerinit-$VERSION ++ + # sha1 our new dockerinit to ensure separate docker and dockerinit always run in a perfect pair compiled for one another + export DOCKER_INITSHA1=$($sha1sum "$DEST/dockerinit-$VERSION" | cut -d' ' -f1) From fc329e1c4cd719b55006e683130776a8d80f52783386719767a40f808495e64d Mon Sep 17 00:00:00 2001 From: Flavio Castelli Date: Wed, 24 Jun 2015 09:02:29 +0000 Subject: [PATCH 5/9] - Build man pages only on platforms where gc compiler is available. OBS-URL: https://build.opensuse.org/package/show/Virtualization:containers/docker?expand=0&rev=13 --- docker.changes | 5 +++++ docker.spec | 8 +++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/docker.changes b/docker.changes index 408e374..408b3fc 100644 --- a/docker.changes +++ b/docker.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Jun 24 09:02:03 UTC 2015 - fcastelli@suse.com + +- Build man pages only on platforms where gc compiler is available. + ------------------------------------------------------------------- Mon Jun 22 08:48:11 UTC 2015 - fcastelli@suse.com diff --git a/docker.spec b/docker.spec index e417064..d4a4840 100644 --- a/docker.spec +++ b/docker.spec @@ -55,8 +55,8 @@ BuildRequires: glibc-devel-static BuildRequires: gcc5-go >= 5.0 %else BuildRequires: go >= 1.4 -%endif BuildRequires: go-go-md2man +%endif BuildRequires: libapparmor-devel BuildRequires: libbtrfs-devel >= 3.8 BuildRequires: procps @@ -155,8 +155,10 @@ export DOCKER_GITCOMMIT=%{git_version} EOF ) > docker_build_env . ./docker_build_env +%ifnarch ppc ppc64 s390x ppc64p7 ppc64le ./hack/make.sh dynbinary man/md2man-all.sh +%endif # remove other than systemd # otherwise the resulting package will have extra requires rm -rf hack/make/.build-deb @@ -198,11 +200,13 @@ install -D -m 644 %SOURCE100 %{buildroot}/var/adm/fillup-templates/sysconfig.doc install -D -m 644 %SOURCE4 %{buildroot}/var/adm/fillup-templates/sysconfig.docker %endif +%ifnarch ppc ppc64 s390x ppc64p7 ppc64le # install manpages install -d %{buildroot}%{_mandir}/man1 install -p -m 644 man/man1/*.1 %{buildroot}%{_mandir}/man1 install -d %{buildroot}%{_mandir}/man5 install -p -m 644 man/man5/Dockerfile.5 %{buildroot}%{_mandir}/man5 +%endif %pre echo "creating group docker..." @@ -230,9 +234,11 @@ groupadd -r docker 2>/dev/null || : %{_unitdir}/%{name}.socket %{_prefix}/lib/udev/rules.d/80-%{name}.rules /var/adm/fillup-templates/sysconfig.docker +%ifnarch ppc ppc64 s390x ppc64p7 ppc64le %{_mandir}/man1/docker-*.1.gz %{_mandir}/man1/docker.1.gz %{_mandir}/man5/Dockerfile.5.gz +%endif %files bash-completion %defattr(-,root,root) From 4931d03fff1783dafb106d5b1dae9800938edc4946f407e69a91ac155f979e2b Mon Sep 17 00:00:00 2001 From: Flavio Castelli Date: Fri, 26 Jun 2015 14:30:44 +0000 Subject: [PATCH 6/9] Accepting request 313847 from home:dirkmueller:branches:Virtualization:containers - rediff ignore-dockerinit-checksum.patch, gcc-go-build-static-libgo.patch to make them apply again. - introduce go_arches for architectures that use the go compiler instead of gcc-go - add docker-netns-aarch64.patch: Add support for AArch64 - enable build for aarch64 OBS-URL: https://build.opensuse.org/request/show/313847 OBS-URL: https://build.opensuse.org/package/show/Virtualization:containers/docker?expand=0&rev=14 --- docker-netns-aarch64.patch | 10 ++++++++++ docker.changes | 10 ++++++++++ docker.spec | 29 ++++++++++++++++------------- gcc-go-build-static-libgo.patch | 22 ++++------------------ ignore-dockerinit-checksum.patch | 8 +++----- 5 files changed, 43 insertions(+), 36 deletions(-) create mode 100644 docker-netns-aarch64.patch diff --git a/docker-netns-aarch64.patch b/docker-netns-aarch64.patch new file mode 100644 index 0000000..87473c9 --- /dev/null +++ b/docker-netns-aarch64.patch @@ -0,0 +1,10 @@ +--- /dev/null ++++ vendor/src/github.com/vishvananda/netns/netns_linux_arm64.go +@@ -0,0 +1,7 @@ ++// +build linux,arm64 ++ ++package netns ++ ++const ( ++ SYS_SETNS = 268 ++) diff --git a/docker.changes b/docker.changes index 408b3fc..2253472 100644 --- a/docker.changes +++ b/docker.changes @@ -1,3 +1,13 @@ +------------------------------------------------------------------- +Thu Jun 25 16:49:59 UTC 2015 - dmueller@suse.com + +- rediff ignore-dockerinit-checksum.patch, gcc-go-build-static-libgo.patch + to make them apply again. +- introduce go_arches for architectures that use the go compiler + instead of gcc-go +- add docker-netns-aarch64.patch: Add support for AArch64 +- enable build for aarch64 + ------------------------------------------------------------------- Wed Jun 24 09:02:03 UTC 2015 - fcastelli@suse.com diff --git a/docker.spec b/docker.spec index d4a4840..0e07385 100644 --- a/docker.spec +++ b/docker.spec @@ -17,6 +17,7 @@ %define git_version 0baf609 +%define go_arches %ix86 x86_64 Name: docker Version: 1.7.0 Release: 0 @@ -48,14 +49,15 @@ Patch1: libcontainer-apparmor-fixes.patch # to simply disable this check Patch100: ignore-dockerinit-checksum.patch Patch101: gcc-go-build-static-libgo.patch +Patch102: docker-netns-aarch64.patch BuildRequires: bash-completion BuildRequires: device-mapper-devel >= 1.2.68 BuildRequires: glibc-devel-static -%ifarch ppc ppc64 s390x ppc64p7 ppc64le -BuildRequires: gcc5-go >= 5.0 -%else +%ifarch %go_arches BuildRequires: go >= 1.4 BuildRequires: go-go-md2man +%else +BuildRequires: gcc5-go >= 5.0 %endif BuildRequires: libapparmor-devel BuildRequires: libbtrfs-devel >= 3.8 @@ -114,10 +116,10 @@ Summary: Test package for docker Group: System/Management Requires: device-mapper-devel >= 1.2.68 Requires: glibc-devel-static -%ifarch ppc ppc64 s390x ppc64p7 ppc64le -Requires: gcc5-go >= 5.0 +%ifarch %go_arches +Requires: go >= 1.4 %else -Requires: go >= 1.3 +Requires: gcc5-go >= 5.0 %endif Requires: apparmor-parser Requires: bash-completion @@ -134,15 +136,16 @@ Test package for docker. It contains the source code and the tests. %setup -q -n docker %patch0 -p1 %patch1 -p1 -%ifarch ppc ppc64 s390x ppc64p7 ppc64le -%patch100 -p1 -%patch101 -p1 +%ifnarch %go_arches +%patch100 +%patch101 %endif +%patch102 cp %{SOURCE7} . find . -name ".gitignore" | xargs rm %build -%ifarch ppc ppc64 s390x ppc64p7 ppc64le +%ifnarch %go_arches mkdir /tmp/dirty-hack ln -s /usr/bin/go-5 /tmp/dirty-hack/go export PATH=/tmp/dirty-hack:$PATH @@ -155,8 +158,8 @@ export DOCKER_GITCOMMIT=%{git_version} EOF ) > docker_build_env . ./docker_build_env -%ifnarch ppc ppc64 s390x ppc64p7 ppc64le ./hack/make.sh dynbinary +%ifarch %go_arches man/md2man-all.sh %endif # remove other than systemd @@ -200,7 +203,7 @@ install -D -m 644 %SOURCE100 %{buildroot}/var/adm/fillup-templates/sysconfig.doc install -D -m 644 %SOURCE4 %{buildroot}/var/adm/fillup-templates/sysconfig.docker %endif -%ifnarch ppc ppc64 s390x ppc64p7 ppc64le +%ifarch %go_arches # install manpages install -d %{buildroot}%{_mandir}/man1 install -p -m 644 man/man1/*.1 %{buildroot}%{_mandir}/man1 @@ -234,7 +237,7 @@ groupadd -r docker 2>/dev/null || : %{_unitdir}/%{name}.socket %{_prefix}/lib/udev/rules.d/80-%{name}.rules /var/adm/fillup-templates/sysconfig.docker -%ifnarch ppc ppc64 s390x ppc64p7 ppc64le +%ifarch %go_arches %{_mandir}/man1/docker-*.1.gz %{_mandir}/man1/docker.1.gz %{_mandir}/man5/Dockerfile.5.gz diff --git a/gcc-go-build-static-libgo.patch b/gcc-go-build-static-libgo.patch index 888799f..e4096fd 100644 --- a/gcc-go-build-static-libgo.patch +++ b/gcc-go-build-static-libgo.patch @@ -1,22 +1,8 @@ -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 +--- hack/make/binary ++++ hack/make/binary +@@ -9,6 +9,7 @@ + echo "Building: $DEST/$BINARY_FULLNAME" go build \ + -gccgoflags="-static-libgo" \ -o "$DEST/$BINARY_FULLNAME" \ diff --git a/ignore-dockerinit-checksum.patch b/ignore-dockerinit-checksum.patch index 2f33404..e25eff8 100644 --- a/ignore-dockerinit-checksum.patch +++ b/ignore-dockerinit-checksum.patch @@ -1,8 +1,6 @@ -Index: docker/utils/utils.go -=================================================================== ---- docker.orig/utils/utils.go -+++ docker/utils/utils.go -@@ -110,7 +110,7 @@ +--- utils/utils.go ++++ utils/utils.go +@@ -76,7 +76,7 @@ } return os.SameFile(targetFileInfo, selfPathFileInfo) } From b6026f9ffeacc74be66bcb081a9f92f27f132fb484f7e44a832b935beab5896c Mon Sep 17 00:00:00 2001 From: Jordi Massaguer Date: Wed, 1 Jul 2015 12:33:12 +0000 Subject: [PATCH 7/9] Exclude %ix86 arch. docker does not build for 32 bits. We have to explicitely exclude it or this can't go to openSUSE:Factory OBS-URL: https://build.opensuse.org/package/show/Virtualization:containers/docker?expand=0&rev=15 --- docker.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/docker.spec b/docker.spec index 0e07385..072883e 100644 --- a/docker.spec +++ b/docker.spec @@ -81,6 +81,7 @@ Requires: xz >= 4.9 Conflicts: lxc < 1.0 PreReq: %fillup_prereq BuildRoot: %{_tmppath}/%{name}-%{version}-build +ExcludeArch: %ix86 %description Docker complements LXC with a high-level API which operates at the process From a90ce89d3f8f7fd389a1f27be4b634b59e1c3083064420637277b75cbca2796d Mon Sep 17 00:00:00 2001 From: Jordi Massaguer Date: Wed, 1 Jul 2015 12:36:58 +0000 Subject: [PATCH 8/9] update changelog OBS-URL: https://build.opensuse.org/package/show/Virtualization:containers/docker?expand=0&rev=16 --- docker.changes | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docker.changes b/docker.changes index 2253472..d0849cb 100644 --- a/docker.changes +++ b/docker.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Jul 1 12:38:50 UTC 2015 - jmassaguerpla@suse.com + +- Exclude intel 32 bits arch. Docker does not built on that. Let's + make it explicit. + ------------------------------------------------------------------- Thu Jun 25 16:49:59 UTC 2015 - dmueller@suse.com From 85c8df8f2f5d58f05d111d2d3285220448654cab662b44f5f05ebf9ac1ad4d98 Mon Sep 17 00:00:00 2001 From: Jordi Massaguer Date: Fri, 10 Jul 2015 11:27:13 +0000 Subject: [PATCH 9/9] - Exclude init scripts other than systemd from the test-package OBS-URL: https://build.opensuse.org/package/show/Virtualization:containers/docker?expand=0&rev=17 --- docker.changes | 5 +++++ docker.spec | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/docker.changes b/docker.changes index d0849cb..8096917 100644 --- a/docker.changes +++ b/docker.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Fri Jul 10 11:22:00 UTC 2015 - jmassaguerpla@suse.com + +- Exclude init scripts other than systemd from the test-package + ------------------------------------------------------------------- Wed Jul 1 12:38:50 UTC 2015 - jmassaguerpla@suse.com diff --git a/docker.spec b/docker.spec index 072883e..8f5f23e 100644 --- a/docker.spec +++ b/docker.spec @@ -255,6 +255,12 @@ groupadd -r docker 2>/dev/null || : %files test %defattr(-,root,root) /usr/src/docker/ +# exclude binaries %exclude /usr/src/docker/bundles/ +# exclude init configurations other than systemd +%exclude /usr/src/docker/contrib/init/openrc +%exclude /usr/src/docker/contrib/init/sysvinit-debian +%exclude /usr/src/docker/contrib/init/sysvinit-redhat +%exclude /usr/src/docker/contrib/init/upstart %changelog