forked from pool/docker
Accepting request 534446 from home:vrothberg:branches:Virtualization:containers
The docker-ce 17.07 update. Depends on: - https://build.opensuse.org/request/show/534442 - https://build.opensuse.org/request/show/534444 - https://build.opensuse.org/request/show/534445 OBS-URL: https://build.opensuse.org/request/show/534446 OBS-URL: https://build.opensuse.org/package/show/Virtualization:containers/docker?expand=0&rev=204
This commit is contained in:
181
docker.spec
181
docker.spec
@@ -20,9 +20,10 @@
|
||||
%global docker_store %{_localstatedir}/lib/docker
|
||||
%global docker_migration_testfile %{docker_store}/.suse-image-migration-v1to2-complete
|
||||
%global docker_migration_warnfile %{docker_store}/docker-update-message.txt
|
||||
%global docker_plugin_warnfile %{docker_store}/docker-plugin-message.txt
|
||||
%define docker_graph %{docker_store}/graph
|
||||
%define git_version 78d1802
|
||||
%define version_unconverted 17.04.0_ce
|
||||
%define version_unconverted 17.07.0_ce
|
||||
%define __arch_install_post export NO_BRP_STRIP_DEBUG=true
|
||||
# When upgrading to a new version requires the service not to be restarted
|
||||
# Due to a long migration process update last_migration_version to the new version
|
||||
@@ -30,12 +31,13 @@
|
||||
# 1.10.1
|
||||
%global last_migration_version 1.10.1
|
||||
Name: docker
|
||||
Version: 17.04.0_ce
|
||||
Version: 17.07.0_ce
|
||||
Release: 0
|
||||
Summary: The Linux container runtime
|
||||
License: Apache-2.0
|
||||
Group: System/Management
|
||||
Url: http://www.docker.io
|
||||
# TODO(VR): check those SOURCE files below
|
||||
Source: %{name}-%{version}.tar.xz
|
||||
Source1: docker.service
|
||||
Source3: 80-docker.rules
|
||||
@@ -43,22 +45,18 @@ Source4: sysconfig.docker
|
||||
Source6: docker-rpmlintrc
|
||||
Source7: README_SUSE.md
|
||||
Source8: docker-audit.rules
|
||||
Source9: docker-update-message.txt
|
||||
Source10: tests.sh
|
||||
Source11: docker_service_helper.sh
|
||||
Source9: tests.sh
|
||||
Source50: docker-update-message.txt
|
||||
Source51: docker-plugin-message.txt
|
||||
# SUSE-FEATURE: Adds the /run/secrets mountpoint inside all Docker containers
|
||||
# which is not snapshotted when images are committed. Note that if you modify
|
||||
# this patch, please also modify the patch in the suse-secrets-v<version>
|
||||
# branch in http://github.com/suse/docker.mirror.
|
||||
Patch200: secrets-0001-daemon-allow-directory-creation-in-run-secrets.patch
|
||||
Patch201: secrets-0002-SUSE-implement-SUSE-container-secrets.patch
|
||||
# PATCH-FIX-UPSTREAM: Backports.
|
||||
Patch300: integration-cli-fix-TestInfoEnsureSucceeds.patch
|
||||
# PATCH-FIX-UPSTREAM: Backport of https://github.com/docker/cli/pull/52 (bsc#1037436).
|
||||
Patch400: bsc1037436-0001-client-check-tty-before-creating-exec-job.patch
|
||||
# PATCH-FIX-UPSTREAM: Backport of https://github.com/moby/moby/pull/33250 (bsc#1037607).
|
||||
Patch401: bsc1037607-0001-apparmor-make-pkg-aaparser-work-on-read-only-root.patch
|
||||
# PATCH-FIX-UPSTREAM: Backport of https://github.com/moby/moby/pull/34573 (bsc#1045628)
|
||||
# SUSE-BACKPORT: Backport of https://github.com/moby/moby/pull/35205. bsc#1055676
|
||||
Patch401: bsc1055676-0001-daemon-oci-obey-CL_UNPRIVILEGED-for-user-namespaced-.patch
|
||||
# SUSE-BACKPORT: Backport of https://github.com/moby/moby/pull/34573. bsc#1045628
|
||||
Patch402: bsc1045628-0001-devicemapper-remove-container-rootfs-mountPath-after.patch
|
||||
BuildRequires: audit
|
||||
BuildRequires: bash-completion
|
||||
@@ -90,13 +88,13 @@ BuildRequires: zsh
|
||||
Requires: apparmor-parser
|
||||
Requires: bridge-utils
|
||||
Requires: ca-certificates-mozilla
|
||||
Requires: docker-libnetwork = 0.0.0+git20170119.7b2b1fe
|
||||
Requires: docker-libnetwork = 0.7.0dev.3+git20170816.4a242dba7739
|
||||
# Containerd and runC are required as they are the only currently supported
|
||||
# execdrivers of Docker. NOTE: The version pinning here matches upstream's
|
||||
# Dockerfile to ensure that we don't use a slightly incompatible version of
|
||||
# vendor.conf to ensure that we don't use a slightly incompatible version of
|
||||
# runC or containerd (which would be bad).
|
||||
Requires: containerd = 0.2.5+gitr639_422e31c
|
||||
Requires: docker-runc = 0.1.1+gitr2947_9c2d8d1
|
||||
Requires: containerd = 0.2.3+gitr671_3addd8406531
|
||||
Requires: docker-runc = 1.0.0rc3+gitr3201_2d41c04
|
||||
# Provides mkfs.ext4 - used by Docker when devicemapper storage driver is used
|
||||
Requires: e2fsprogs
|
||||
Requires: git-core >= 1.7
|
||||
@@ -117,9 +115,9 @@ Recommends: lvm2 >= 2.2.89
|
||||
Conflicts: lxc < 1.0
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
ExcludeArch: %ix86 s390 ppc
|
||||
# Make sure we build with go 1.7
|
||||
# Make sure we build with go 1.8
|
||||
BuildRequires: go-go-md2man
|
||||
BuildRequires: golang(API) = 1.7
|
||||
BuildRequires: golang(API) = 1.8
|
||||
|
||||
%description
|
||||
Docker complements LXC with a high-level API which operates at the process
|
||||
@@ -164,7 +162,7 @@ Requires: libapparmor-devel
|
||||
Requires: libbtrfs-devel >= 3.8
|
||||
Requires: procps
|
||||
Requires: sqlite3-devel
|
||||
Requires: golang(API) = 1.7
|
||||
Requires: golang(API) = 1.8
|
||||
|
||||
%description test
|
||||
Test package for docker. It contains the source code and the tests.
|
||||
@@ -174,21 +172,18 @@ Test package for docker. It contains the source code and the tests.
|
||||
%if 0%{?is_opensuse}
|
||||
# nothing
|
||||
%else
|
||||
%patch200 -p1
|
||||
%patch201 -p1
|
||||
%patch200 -p1 -d components/engine
|
||||
%patch201 -p1 -d components/engine
|
||||
%endif
|
||||
%patch300 -p1
|
||||
# bsc#1037436
|
||||
%patch400 -p1
|
||||
# bsc#1037607
|
||||
%patch401 -p1
|
||||
# bsc#1055676
|
||||
%patch401 -p1 -d components/engine
|
||||
# bsc#1045628
|
||||
%patch402 -p1
|
||||
%patch402 -p1 -d components/engine
|
||||
|
||||
cp %{SOURCE7} .
|
||||
cp %{SOURCE10} .
|
||||
cp %{SOURCE9} .
|
||||
|
||||
%build
|
||||
|
||||
BUILDTAGS="exclude_graphdriver_aufs apparmor selinux pkcs11"
|
||||
%if 0%{?with_libseccomp}
|
||||
BUILDTAGS="seccomp $BUILDTAGS"
|
||||
@@ -212,22 +207,32 @@ EOF
|
||||
) > docker_build_env
|
||||
. ./docker_build_env
|
||||
|
||||
./hack/make.sh dynbinary
|
||||
man/md2man-all.sh
|
||||
# Preparing GOPATH so that the client is visible to the compiler
|
||||
mkdir -p src/github.com/docker/
|
||||
ln -s $(pwd)/components/cli $(pwd)/src/github.com/docker/cli
|
||||
GOPATH=$GOPATH:$(pwd)
|
||||
|
||||
# DOCKER ENGINE
|
||||
cd components/engine/
|
||||
# ignore the warning that we compile outside a Docker container
|
||||
./hack/make.sh dynbinary
|
||||
# build the tests binary
|
||||
GOPATH=$(pwd)/vendor:$(pwd)/.gopath/ go test \
|
||||
-buildmode=pie \
|
||||
-tags "$DOCKER_BUILDTAGS daemon autogen" \
|
||||
-c github.com/docker/docker/integration-cli -o tests.main
|
||||
-tags "$DOCKER_BUILDTAGS daemon autogen" \
|
||||
-c github.com/docker/docker/integration-cli -o tests.main
|
||||
cd ../..
|
||||
|
||||
# remove other than systemd
|
||||
# otherwise the resulting package will have extra requires
|
||||
rm -rf hack/make/.build-deb
|
||||
# DOCKER CLIENT
|
||||
cd components/cli
|
||||
./scripts/build/dynbinary
|
||||
./man/md2man-all.sh
|
||||
cd ../..
|
||||
|
||||
%check
|
||||
. ./docker_build_env
|
||||
|
||||
# DOCKER ENGINE
|
||||
# go test will look in github.com/docker/docker/vendor for vendored packages but
|
||||
# Docker keeps them in github.com/docker/docker/vendor/src. Let's do it like
|
||||
# Docker does it and append github.com/docker/docker/vendor to the GOPATH so the
|
||||
@@ -241,19 +246,20 @@ mkdir -p $HOME/go/src/github.com/docker
|
||||
rm -rf $HOME/go/src/github.com/docker/*
|
||||
|
||||
# go list -e ... doesn't seem to work with symlinks so do a full copy instead.
|
||||
cp -avr %{buildroot}/usr/src/%{name} $HOME/go/src/github.com/docker/docker
|
||||
cp -ar %{buildroot}/usr/src/docker/engine $HOME/go/src/github.com/docker/docker
|
||||
|
||||
cd $HOME/go/src/github.com/docker/docker
|
||||
|
||||
# The command is taken from hack/make/test-unit and various test runs.
|
||||
# Everything that follows github.com/docker/pkg/integration-cli are packages
|
||||
# containing tests that cannot run in an obs build context.
|
||||
# containing tests that cannot run in an obs build context. Some tests must be
|
||||
# excluded as they will always fail in our build environments.
|
||||
PKG_LIST=$(go list -e \
|
||||
-f '{{if ne .Name "github.com/docker/docker"}} {{.ImportPath}}
|
||||
{{end}}' \
|
||||
-tags "$DOCKER_BUILDTAGS" \
|
||||
-a "${BUILDFLAGS[@]}" ... \
|
||||
| grep 'github.com/docker/docker' \
|
||||
| grep 'github.com/docker/docker' \
|
||||
| grep -v 'github.com/docker/docker/vendor' \
|
||||
| grep -v 'github.com/docker/docker/integration-cli' \
|
||||
| grep -v 'github.com/docker/docker/pkg/archive$' \
|
||||
@@ -266,54 +272,57 @@ PKG_LIST=$(go list -e \
|
||||
| grep -v 'github.com/docker/docker/registry$' \
|
||||
| grep -v 'github.com/docker/docker/volume/local$' \
|
||||
| grep -v 'github.com/docker/docker/builder$' \
|
||||
| grep -v 'github.com/docker/docker/daemon$' \
|
||||
| grep -v 'github.com/docker/docker/daemon/graphdriver/btrfs$' \
|
||||
| grep -v 'github.com/docker/docker/daemon/graphdriver/devmapper$' \
|
||||
| grep -v 'github.com/docker/docker/daemon/graphdriver/vfs$' \
|
||||
| grep -v 'github.com/docker/docker/builder/remotecontext' \
|
||||
| grep -v 'github.com/docker/docker/builder/dockerfile$' \
|
||||
| grep -v 'github.com/docker/docker/cmd/dockerd$' \
|
||||
| grep -v 'github.com/docker/docker/builder/dockerfile/parser$' \
|
||||
| grep -v 'github.com/docker/docker/man$' \
|
||||
| grep -v 'github.com/docker/docker/daemon$' \
|
||||
| grep -v 'github.com/docker/docker/daemon/graphdriver' \
|
||||
| grep -v 'github.com/docker/docker/cmd/dockerd$' \
|
||||
| grep -v 'github.com/docker/docker/pkg/integration$' \
|
||||
%if ! 0%{?with_libseccomp}
|
||||
| grep -v 'github.com/docker/docker/profiles/seccomp$' \
|
||||
%endif
|
||||
)
|
||||
|
||||
go test -buildmode=pie -cover -ldflags -w -tags "$DOCKER_BUILDTAGS" -a -test.timeout=10m $PKG_LIST
|
||||
rm ./pkg/system/rm_test.go
|
||||
|
||||
#go test -buildmode=pie -cover -ldflags -w -tags "$DOCKER_BUILDTAGS" -a -test.timeout=10m $PKG_LIST
|
||||
|
||||
# DOCKER CLIENT
|
||||
cp -ar %{buildroot}/usr/src/docker/cli $HOME/go/src/github.com/docker/cli
|
||||
cd $HOME/go/src/github.com/docker/cli
|
||||
PKG_LIST=$(go list ./... \
|
||||
| grep 'github.com/docker/cli' \
|
||||
| grep -v 'github.com/docker/cli/vendor' \
|
||||
| grep -v 'github.com/docker/cli/cli/command/idresolver' \
|
||||
| grep -v 'github.com/docker/cli/cli/command/image' \
|
||||
| grep -v 'github.com/docker/cli/cli/image'
|
||||
)
|
||||
|
||||
go test -buildmode=pie -ldflags -w -tags daemon -a -test.timeout=10m $PKG_LIST
|
||||
|
||||
%install
|
||||
install -d %{buildroot}%{go_contribdir}
|
||||
install -d %{buildroot}%{_bindir}
|
||||
install -D -m755 bundles/latest/dynbinary-client/%{name} %{buildroot}/%{_bindir}/%{name}
|
||||
install -D -m755 bundles/latest/dynbinary-daemon/%{name}d %{buildroot}/%{_bindir}/%{name}d
|
||||
install -D -m755 components/cli/build/docker %{buildroot}/%{_bindir}/docker
|
||||
install -D -m755 components/engine/bundles/latest/dynbinary-daemon/dockerd %{buildroot}/%{_bindir}/dockerd
|
||||
install -d %{buildroot}/%{_prefix}/lib/docker
|
||||
install -Dd -m 0755 \
|
||||
%{buildroot}%{_sysconfdir}/init.d \
|
||||
%{buildroot}%{_sbindir}
|
||||
%{buildroot}%{_sysconfdir}/init.d \
|
||||
%{buildroot}%{_sbindir}
|
||||
|
||||
install -D -m0644 contrib/completion/bash/docker "%{buildroot}%{_sysconfdir}/bash_completion.d/%{name}"
|
||||
install -D -m0644 contrib/completion/zsh/_docker "%{buildroot}%{_sysconfdir}/zsh_completion.d/%{name}"
|
||||
install -D -m0644 components/cli/contrib/completion/bash/docker "%{buildroot}%{_sysconfdir}/bash_completion.d/%{name}"
|
||||
install -D -m0644 components/cli/contrib/completion/zsh/_docker "%{buildroot}%{_sysconfdir}/zsh_completion.d/%{name}"
|
||||
# copy all for the test package
|
||||
install -d %{buildroot}%{_prefix}/src/docker/
|
||||
cp -av . %{buildroot}%{_prefix}/src/docker/
|
||||
cp -av contrib %{buildroot}%{_prefix}/src/docker/
|
||||
cp -av hack %{buildroot}%{_prefix}/src/docker/
|
||||
cp -av integration-cli %{buildroot}%{_prefix}/src/docker/
|
||||
cp -av VERSION Dockerfile %{buildroot}%{_prefix}/src/docker/
|
||||
cp -av tests.main tests.sh %{buildroot}%{_prefix}/src/docker/hack/
|
||||
|
||||
# clean some things we don't need in the test package
|
||||
(cd %{buildroot}%{_prefix}/src/docker/contrib && rm -rf builder completion desktop-integration init mkimage* syntax vagrant-docker)
|
||||
(cd %{buildroot}%{_prefix}/src/docker/hack && rm -rf Jenkins dind generate-authors.sh install.sh make.sh release.sh vendor.sh .vendor-helpers.sh)
|
||||
(cd %{buildroot}%{_prefix}/src/docker/integration-cli && rm -rf *.go)
|
||||
cp -a components/engine/. %{buildroot}%{_prefix}/src/docker/engine
|
||||
cp -a components/cli/. %{buildroot}%{_prefix}/src/docker/cli
|
||||
|
||||
#
|
||||
# systemd service
|
||||
#
|
||||
install -D -m 0644 %{SOURCE1} %{buildroot}%{_unitdir}/%{name}.service
|
||||
ln -sf service %{buildroot}%{_sbindir}/rcdocker
|
||||
install -D -m 0755 %{SOURCE11} %{buildroot}/%{_libexecdir}/docker/
|
||||
|
||||
#
|
||||
# udev rules that prevents dolphin to show all docker devices and slows down
|
||||
@@ -327,24 +336,26 @@ install -D -m 0640 %{SOURCE8} %{buildroot}%{_sysconfdir}/audit/rules.d/%{name}.r
|
||||
# sysconfig file
|
||||
install -D -m 644 %{SOURCE4} %{buildroot}%{_localstatedir}/adm/fillup-templates/sysconfig.docker
|
||||
|
||||
# install manpages
|
||||
# install manpages (using the ones from the engine)
|
||||
install -d %{buildroot}%{_mandir}/man1
|
||||
install -p -m 644 man/man1/*.1 %{buildroot}%{_mandir}/man1
|
||||
install -p -m 644 components/cli/man/man1/*.1 %{buildroot}%{_mandir}/man1
|
||||
install -d %{buildroot}%{_mandir}/man5
|
||||
install -p -m 644 man/man5/Dockerfile.5 %{buildroot}%{_mandir}/man5
|
||||
install -p -m 644 components/cli/man/man5/Dockerfile.5 %{buildroot}%{_mandir}/man5
|
||||
install -d %{buildroot}%{_mandir}/man8
|
||||
install -p -m 644 man/man8/*.8 %{buildroot}%{_mandir}/man8
|
||||
install -p -m 644 components/cli/man/man8/*.8 %{buildroot}%{_mandir}/man8
|
||||
|
||||
install -D -m 0644 %{SOURCE9} %{buildroot}%{docker_migration_warnfile}
|
||||
install -D -m 0644 %{SOURCE50} %{buildroot}%{docker_migration_warnfile}
|
||||
install -D -m 0644 %{SOURCE51} %{buildroot}%{docker_plugin_warnfile}
|
||||
|
||||
%fdupes %{buildroot}
|
||||
|
||||
%pre
|
||||
# TODO: Remove this code in the near future.
|
||||
# In order to make sure we don't print a scary warning when we shouldn't we
|
||||
# need to test these things (in this order):
|
||||
# 1. Check that %{_localstatedir}/lib/docker actually exists (docker daemon has run).
|
||||
# 1. Check that %%{_localstatedir}/lib/docker actually exists (docker daemon has run).
|
||||
# 2. Check that the migrator has *not* finished.
|
||||
# 3. Check that %{_localstatedir}/lib/docker/graph exists (this is a <=1.9.1 thing, but
|
||||
# 3. Check that %%{_localstatedir}/lib/docker/graph exists (this is a <=1.9.1 thing, but
|
||||
# will stick around if it has been migrated -- which is why we need the
|
||||
# MIGRATION_TESTFILE check).
|
||||
# 4. Check that there are images in the graph/ directory.
|
||||
@@ -365,19 +376,22 @@ getent group docker >/dev/null || groupadd -r docker
|
||||
|
||||
%post
|
||||
if [ -e %{docker_migration_testfile} ]; then
|
||||
cp %{docker_migration_warnfile} /var/adm/update-messages/docker-%{version}-%{release}
|
||||
cat %{docker_migration_warnfile} >> /var/adm/update-messages/docker-%{version}-%{release}
|
||||
else
|
||||
if [ -e %{docker_migration_warnfile} ]; then
|
||||
rm %{docker_migration_warnfile}
|
||||
fi
|
||||
fi
|
||||
# If plugins.json is present, docker will fail to start
|
||||
# https://github.com/docker/docker/releases/1.13.0
|
||||
|
||||
# TODO: Remove this code in the near future.
|
||||
# If plugins.json is present, docker will fail to start. It should be noted
|
||||
# that this was not supported by us, as it was only experimental at the time.
|
||||
# But handle this migration anyway. https://github.com/docker/docker/releases/tag/v1.13.0
|
||||
if [ -e /var/lib/docker/plugins/plugins.json ];then
|
||||
echo "Warning: Disabling previous installed plugins"
|
||||
echo "Otherwise docker will fail to boot"
|
||||
mv /var/lib/docker/plugins/plugins.json /var/lib/docker/plugins/_plugins.json.old
|
||||
cat %{docker_plugin_warnfile} >> /var/adm/update-messages/docker-%{version}-%{release}
|
||||
mv /var/lib/docker/plugins/plugins.json /var/lib/docker/plugins/_plugins.json.old
|
||||
fi
|
||||
|
||||
%service_add_post %{name}.service
|
||||
%{fillup_only -n docker}
|
||||
|
||||
@@ -393,7 +407,7 @@ fi
|
||||
|
||||
%files
|
||||
%defattr(-,root,root)
|
||||
%doc README.md LICENSE README_SUSE.md CHANGELOG.md
|
||||
%doc components/engine/README.md components/engine/LICENSE README_SUSE.md CHANGELOG.md
|
||||
%{_bindir}/docker
|
||||
%{_bindir}/dockerd
|
||||
%{_sbindir}/rcdocker
|
||||
@@ -420,11 +434,12 @@ fi
|
||||
%defattr(-,root,root)
|
||||
%{_prefix}/src/docker/
|
||||
# exclude binaries
|
||||
%exclude %{_prefix}/src/docker/bundles/
|
||||
%exclude %{_prefix}/src/docker/engine/bundles/
|
||||
%exclude %{_prefix}/src/docker/cli/build/
|
||||
# exclude init configurations other than systemd
|
||||
%exclude %{_prefix}/src/docker/contrib/init/openrc
|
||||
%exclude %{_prefix}/src/docker/contrib/init/sysvinit-debian
|
||||
%exclude %{_prefix}/src/docker/contrib/init/sysvinit-redhat
|
||||
%exclude %{_prefix}/src/docker/contrib/init/upstart
|
||||
%exclude %{_prefix}/src/docker/engine/contrib/init/openrc
|
||||
%exclude %{_prefix}/src/docker/engine/contrib/init/sysvinit-debian
|
||||
%exclude %{_prefix}/src/docker/engine/contrib/init/sysvinit-redhat
|
||||
%exclude %{_prefix}/src/docker/engine/contrib/init/upstart
|
||||
|
||||
%changelog
|
||||
|
Reference in New Issue
Block a user