2014-08-01 11:48:31 +02:00
|
|
|
#
|
2014-07-17 17:31:28 +02:00
|
|
|
# spec file for package docker
|
2014-08-01 11:48:31 +02:00
|
|
|
#
|
2017-01-13 14:05:35 +01:00
|
|
|
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
|
2014-07-17 17:31:28 +02:00
|
|
|
#
|
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
# published by the Open Source Initiative.
|
|
|
|
|
|
|
|
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
|
|
|
#
|
2016-06-21 12:05:57 +02:00
|
|
|
# nodebuginfo
|
2014-07-17 17:31:28 +02:00
|
|
|
|
2014-08-01 11:48:31 +02:00
|
|
|
|
2016-08-09 11:44:19 +02:00
|
|
|
%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
|
2017-10-18 06:27:06 +02:00
|
|
|
%global docker_plugin_warnfile %{docker_store}/docker-plugin-message.txt
|
2016-03-15 12:35:05 +01:00
|
|
|
%define docker_graph %{docker_store}/graph
|
2017-01-13 18:01:50 +01:00
|
|
|
%define git_version 78d1802
|
2017-10-18 06:27:06 +02:00
|
|
|
%define version_unconverted 17.07.0_ce
|
2016-06-21 12:05:57 +02:00
|
|
|
%define __arch_install_post export NO_BRP_STRIP_DEBUG=true
|
2016-08-09 11:44:19 +02:00
|
|
|
# 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
|
|
|
|
# that will first perform the migration, last time this was needed was version
|
|
|
|
# 1.10.1
|
|
|
|
%global last_migration_version 1.10.1
|
2014-07-17 17:31:28 +02:00
|
|
|
Name: docker
|
2017-10-18 06:27:06 +02:00
|
|
|
Version: 17.07.0_ce
|
2014-07-17 17:31:28 +02:00
|
|
|
Release: 0
|
|
|
|
Summary: The Linux container runtime
|
|
|
|
License: Apache-2.0
|
|
|
|
Group: System/Management
|
|
|
|
Url: http://www.docker.io
|
2017-10-18 06:27:06 +02:00
|
|
|
# TODO(VR): check those SOURCE files below
|
2015-10-12 22:33:58 +02:00
|
|
|
Source: %{name}-%{version}.tar.xz
|
2014-07-17 17:31:28 +02:00
|
|
|
Source1: docker.service
|
|
|
|
Source3: 80-docker.rules
|
|
|
|
Source4: sysconfig.docker
|
|
|
|
Source6: docker-rpmlintrc
|
2014-08-16 15:38:01 +02:00
|
|
|
Source7: README_SUSE.md
|
2015-12-23 11:57:20 +01:00
|
|
|
Source8: docker-audit.rules
|
2017-10-18 06:27:06 +02:00
|
|
|
Source9: tests.sh
|
|
|
|
Source50: docker-update-message.txt
|
|
|
|
Source51: docker-plugin-message.txt
|
2016-10-11 12:30:52 +02:00
|
|
|
# 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.
|
2017-03-08 10:03:15 +01:00
|
|
|
Patch200: secrets-0001-daemon-allow-directory-creation-in-run-secrets.patch
|
|
|
|
Patch201: secrets-0002-SUSE-implement-SUSE-container-secrets.patch
|
2017-10-18 06:27:06 +02:00
|
|
|
# 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
|
2017-09-07 09:53:28 +02:00
|
|
|
Patch402: bsc1045628-0001-devicemapper-remove-container-rootfs-mountPath-after.patch
|
2015-12-23 11:57:20 +01:00
|
|
|
BuildRequires: audit
|
2014-07-17 17:31:28 +02:00
|
|
|
BuildRequires: bash-completion
|
2017-03-05 04:07:44 +01:00
|
|
|
BuildRequires: ca-certificates
|
2014-07-17 17:31:28 +02:00
|
|
|
BuildRequires: device-mapper-devel >= 1.2.68
|
|
|
|
BuildRequires: glibc-devel-static
|
2014-08-01 11:48:31 +02:00
|
|
|
BuildRequires: libapparmor-devel
|
2014-07-17 17:31:28 +02:00
|
|
|
BuildRequires: libbtrfs-devel >= 3.8
|
2017-07-27 18:11:06 +02:00
|
|
|
# enable libseccomp for sle >= sle12sp2
|
|
|
|
%if 0%{?sle_version} >= 120200
|
|
|
|
%define with_libseccomp 1
|
|
|
|
%endif
|
|
|
|
# enable libseccomp for leap >= 42.2
|
|
|
|
%if 0%{?leap_version} >= 420200
|
|
|
|
%define with_libseccomp 1
|
|
|
|
%endif
|
|
|
|
# enable libseccomp for Factory
|
|
|
|
%if 0%{?suse_version} > 1320
|
2017-03-31 13:32:13 +02:00
|
|
|
%define with_libseccomp 1
|
|
|
|
%endif
|
|
|
|
%if 0%{?with_libseccomp}
|
2017-03-05 04:07:44 +01:00
|
|
|
BuildRequires: libseccomp-devel
|
2017-03-31 13:32:13 +02:00
|
|
|
%endif
|
2017-03-05 04:07:44 +01:00
|
|
|
BuildRequires: libtool
|
2014-07-17 17:31:28 +02:00
|
|
|
BuildRequires: procps
|
|
|
|
BuildRequires: sqlite3-devel
|
|
|
|
BuildRequires: systemd-devel
|
|
|
|
BuildRequires: zsh
|
2014-08-01 11:48:31 +02:00
|
|
|
Requires: apparmor-parser
|
2014-07-17 17:31:28 +02:00
|
|
|
Requires: bridge-utils
|
|
|
|
Requires: ca-certificates-mozilla
|
2017-10-18 06:27:06 +02:00
|
|
|
Requires: docker-libnetwork = 0.7.0dev.3+git20170816.4a242dba7739
|
2016-08-16 12:57:11 +02:00
|
|
|
# Containerd and runC are required as they are the only currently supported
|
|
|
|
# execdrivers of Docker. NOTE: The version pinning here matches upstream's
|
2017-10-18 06:27:06 +02:00
|
|
|
# vendor.conf to ensure that we don't use a slightly incompatible version of
|
2016-08-16 12:57:11 +02:00
|
|
|
# runC or containerd (which would be bad).
|
2017-10-18 06:27:06 +02:00
|
|
|
Requires: containerd = 0.2.3+gitr671_3addd8406531
|
|
|
|
Requires: docker-runc = 1.0.0rc3+gitr3201_2d41c04
|
2015-01-22 21:49:38 +01:00
|
|
|
# Provides mkfs.ext4 - used by Docker when devicemapper storage driver is used
|
|
|
|
Requires: e2fsprogs
|
2014-07-17 17:31:28 +02:00
|
|
|
Requires: git-core >= 1.7
|
|
|
|
Requires: iproute2 >= 3.5
|
|
|
|
Requires: iptables >= 1.4
|
|
|
|
Requires: procps
|
|
|
|
Requires: tar >= 1.26
|
|
|
|
Requires: xz >= 4.9
|
2016-06-21 12:05:57 +02:00
|
|
|
Requires(post): %fillup_prereq
|
|
|
|
Requires(post): udev
|
2017-03-07 11:40:30 +01:00
|
|
|
Requires(post): shadow
|
2016-03-15 12:47:01 +01:00
|
|
|
# Not necessary, but must be installed to have a smooth upgrade.
|
|
|
|
Recommends: docker-image-migrator
|
2017-04-11 11:17:58 +02:00
|
|
|
# Not necessary, but must be installed when the underlying system is
|
|
|
|
# configured to use lvm and the user doesn't explicitly provide a
|
|
|
|
# different storage-driver than devicemapper
|
|
|
|
Recommends: lvm2 >= 2.2.89
|
2014-08-01 11:48:31 +02:00
|
|
|
Conflicts: lxc < 1.0
|
2014-07-17 17:31:28 +02:00
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
2016-06-21 12:05:57 +02:00
|
|
|
ExcludeArch: %ix86 s390 ppc
|
2017-10-18 06:27:06 +02:00
|
|
|
# Make sure we build with go 1.8
|
2016-06-21 12:05:57 +02:00
|
|
|
BuildRequires: go-go-md2man
|
2017-10-18 06:27:06 +02:00
|
|
|
BuildRequires: golang(API) = 1.8
|
2016-05-18 16:21:48 +02:00
|
|
|
|
2014-07-17 17:31:28 +02:00
|
|
|
%description
|
|
|
|
Docker complements LXC with a high-level API which operates at the process
|
|
|
|
level. It runs unix processes with strong guarantees of isolation and
|
|
|
|
repeatability across servers.
|
|
|
|
|
|
|
|
Docker is a great building block for automating distributed systems: large-scale
|
|
|
|
web deployments, database clusters, continuous deployment systems, private PaaS,
|
|
|
|
service-oriented architectures, etc.
|
|
|
|
|
|
|
|
%package bash-completion
|
|
|
|
Summary: Bash Completion for %{name}
|
|
|
|
Group: System/Management
|
|
|
|
Requires: %{name} = %{version}
|
2016-12-11 05:45:46 +01:00
|
|
|
Supplements: packageand(docker:bash-completion)
|
2014-07-17 17:31:28 +02:00
|
|
|
BuildArch: noarch
|
|
|
|
|
|
|
|
%description bash-completion
|
|
|
|
Bash command line completion support for %{name}.
|
|
|
|
|
|
|
|
%package zsh-completion
|
|
|
|
Summary: Zsh Completion for %{name}
|
|
|
|
Group: System/Management
|
|
|
|
Requires: %{name} = %{version}
|
2016-04-19 09:54:05 +02:00
|
|
|
Supplements: packageand(docker:zsh)
|
2014-07-17 17:31:28 +02:00
|
|
|
BuildArch: noarch
|
|
|
|
|
|
|
|
%description zsh-completion
|
|
|
|
Zsh command line completion support for %{name}.
|
|
|
|
|
2015-06-10 10:16:24 +02:00
|
|
|
%package test
|
2016-06-21 12:05:57 +02:00
|
|
|
%global __requires_exclude ^libgo.so.*$
|
2015-06-10 10:16:24 +02:00
|
|
|
Summary: Test package for docker
|
|
|
|
Group: System/Management
|
2015-10-12 22:33:58 +02:00
|
|
|
BuildRequires: fdupes
|
2015-06-10 10:16:24 +02:00
|
|
|
Requires: apparmor-parser
|
|
|
|
Requires: bash-completion
|
2016-06-21 12:05:57 +02:00
|
|
|
Requires: device-mapper-devel >= 1.2.68
|
|
|
|
Requires: glibc-devel-static
|
2017-05-04 21:02:51 +02:00
|
|
|
# Make sure we require go 1.7
|
2015-06-10 10:16:24 +02:00
|
|
|
Requires: libapparmor-devel
|
|
|
|
Requires: libbtrfs-devel >= 3.8
|
|
|
|
Requires: procps
|
|
|
|
Requires: sqlite3-devel
|
2017-10-18 06:27:06 +02:00
|
|
|
Requires: golang(API) = 1.8
|
2016-01-20 19:58:55 +01:00
|
|
|
|
2015-06-10 10:16:24 +02:00
|
|
|
%description test
|
|
|
|
Test package for docker. It contains the source code and the tests.
|
|
|
|
|
2014-07-17 17:31:28 +02:00
|
|
|
%prep
|
2016-06-21 12:05:57 +02:00
|
|
|
%setup -q
|
2016-04-15 12:21:32 +02:00
|
|
|
%if 0%{?is_opensuse}
|
|
|
|
# nothing
|
|
|
|
%else
|
2017-10-18 06:27:06 +02:00
|
|
|
%patch200 -p1 -d components/engine
|
|
|
|
%patch201 -p1 -d components/engine
|
2016-04-15 12:21:32 +02:00
|
|
|
%endif
|
2017-10-18 06:27:06 +02:00
|
|
|
# bsc#1055676
|
|
|
|
%patch401 -p1 -d components/engine
|
2017-09-07 09:53:28 +02:00
|
|
|
# bsc#1045628
|
2017-10-18 06:27:06 +02:00
|
|
|
%patch402 -p1 -d components/engine
|
|
|
|
|
2014-08-16 15:38:01 +02:00
|
|
|
cp %{SOURCE7} .
|
2017-10-18 06:27:06 +02:00
|
|
|
cp %{SOURCE9} .
|
2014-07-17 17:31:28 +02:00
|
|
|
|
|
|
|
%build
|
2017-03-31 13:32:13 +02:00
|
|
|
BUILDTAGS="exclude_graphdriver_aufs apparmor selinux pkcs11"
|
|
|
|
%if 0%{?with_libseccomp}
|
|
|
|
BUILDTAGS="seccomp $BUILDTAGS"
|
|
|
|
%endif
|
2017-07-27 18:11:06 +02:00
|
|
|
# For SLE12 libdevmapper.h is not recent enough to define
|
|
|
|
# dm_task_deferred_remove().
|
|
|
|
%if 0%{?sle_version} == 120000
|
2017-03-05 04:07:44 +01:00
|
|
|
BUILDTAGS="libdm_no_deferred_remove $BUILDTAGS"
|
|
|
|
%endif
|
|
|
|
|
2015-06-10 10:16:24 +02:00
|
|
|
(cat <<EOF
|
2014-09-01 16:59:21 +02:00
|
|
|
export AUTO_GOPATH=1
|
2017-03-05 04:07:44 +01:00
|
|
|
export DOCKER_BUILDTAGS="$BUILDTAGS"
|
2014-07-17 17:31:28 +02:00
|
|
|
export DOCKER_GITCOMMIT=%{git_version}
|
2017-05-10 16:04:27 +02:00
|
|
|
# Until boo#1038493 is fixed properly we need to do this hack to get the
|
|
|
|
# compiled-into-the-binary GOROOT.
|
|
|
|
export GOROOT="$(GOROOT= go env GOROOT)"
|
2017-08-11 14:09:59 +02:00
|
|
|
# Make sure we always build PIC code. bsc#1048046
|
|
|
|
export BUILDFLAGS="-buildmode=pie"
|
2015-06-10 10:16:24 +02:00
|
|
|
EOF
|
|
|
|
) > docker_build_env
|
|
|
|
. ./docker_build_env
|
2016-01-20 19:58:55 +01:00
|
|
|
|
2017-10-18 06:27:06 +02:00
|
|
|
# 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)
|
2016-01-20 19:58:55 +01:00
|
|
|
|
2017-10-18 06:27:06 +02:00
|
|
|
# DOCKER ENGINE
|
|
|
|
cd components/engine/
|
|
|
|
# ignore the warning that we compile outside a Docker container
|
|
|
|
./hack/make.sh dynbinary
|
2016-08-26 14:49:06 +02:00
|
|
|
# build the tests binary
|
|
|
|
GOPATH=$(pwd)/vendor:$(pwd)/.gopath/ go test \
|
2017-08-11 14:09:59 +02:00
|
|
|
-buildmode=pie \
|
2017-10-18 06:27:06 +02:00
|
|
|
-tags "$DOCKER_BUILDTAGS daemon autogen" \
|
|
|
|
-c github.com/docker/docker/integration-cli -o tests.main
|
|
|
|
cd ../..
|
2016-08-26 14:49:06 +02:00
|
|
|
|
2017-10-18 06:27:06 +02:00
|
|
|
# DOCKER CLIENT
|
|
|
|
cd components/cli
|
|
|
|
./scripts/build/dynbinary
|
|
|
|
./man/md2man-all.sh
|
|
|
|
cd ../..
|
2014-07-17 17:31:28 +02:00
|
|
|
|
2016-08-23 16:44:42 +02:00
|
|
|
%check
|
|
|
|
. ./docker_build_env
|
|
|
|
|
2017-10-18 06:27:06 +02:00
|
|
|
# DOCKER ENGINE
|
2016-08-23 16:44:42 +02:00
|
|
|
# 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
|
|
|
|
# packages are found by go test.
|
|
|
|
export GOPATH=$HOME/go/src/github.com/docker/docker/vendor:$GOPATH
|
|
|
|
|
|
|
|
# Create or dir if it doesn't exist already
|
|
|
|
mkdir -p $HOME/go/src/github.com/docker
|
|
|
|
|
|
|
|
# Remove any existing symlinks.
|
|
|
|
rm -rf $HOME/go/src/github.com/docker/*
|
|
|
|
|
|
|
|
# go list -e ... doesn't seem to work with symlinks so do a full copy instead.
|
2017-10-18 06:27:06 +02:00
|
|
|
cp -ar %{buildroot}/usr/src/docker/engine $HOME/go/src/github.com/docker/docker
|
2016-08-23 16:44:42 +02:00
|
|
|
|
|
|
|
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
|
2017-10-18 06:27:06 +02:00
|
|
|
# containing tests that cannot run in an obs build context. Some tests must be
|
|
|
|
# excluded as they will always fail in our build environments.
|
2016-08-23 16:44:42 +02:00
|
|
|
PKG_LIST=$(go list -e \
|
|
|
|
-f '{{if ne .Name "github.com/docker/docker"}} {{.ImportPath}}
|
|
|
|
{{end}}' \
|
2017-03-05 04:07:44 +01:00
|
|
|
-tags "$DOCKER_BUILDTAGS" \
|
2016-08-23 16:44:42 +02:00
|
|
|
-a "${BUILDFLAGS[@]}" ... \
|
2017-10-18 06:27:06 +02:00
|
|
|
| grep 'github.com/docker/docker' \
|
2016-08-23 16:44:42 +02:00
|
|
|
| grep -v 'github.com/docker/docker/vendor' \
|
|
|
|
| grep -v 'github.com/docker/docker/integration-cli' \
|
|
|
|
| grep -v 'github.com/docker/docker/pkg/archive$' \
|
|
|
|
| grep -v 'github.com/docker/docker/pkg/chrootarchive$' \
|
|
|
|
| grep -v 'github.com/docker/docker/pkg/gitutils$' \
|
|
|
|
| grep -v 'github.com/docker/docker/pkg/idtools$' \
|
|
|
|
| grep -v 'github.com/docker/docker/pkg/jsonlog$' \
|
|
|
|
| grep -v 'github.com/docker/docker/pkg/mount$' \
|
|
|
|
| grep -v 'github.com/docker/docker/pkg/sysinfo$' \
|
|
|
|
| grep -v 'github.com/docker/docker/registry$' \
|
|
|
|
| grep -v 'github.com/docker/docker/volume/local$' \
|
|
|
|
| grep -v 'github.com/docker/docker/builder$' \
|
2017-10-18 06:27:06 +02:00
|
|
|
| grep -v 'github.com/docker/docker/builder/remotecontext' \
|
2016-08-23 16:44:42 +02:00
|
|
|
| grep -v 'github.com/docker/docker/builder/dockerfile$' \
|
|
|
|
| grep -v 'github.com/docker/docker/builder/dockerfile/parser$' \
|
2017-10-18 06:27:06 +02:00
|
|
|
| grep -v 'github.com/docker/docker/daemon$' \
|
|
|
|
| grep -v 'github.com/docker/docker/daemon/graphdriver' \
|
|
|
|
| grep -v 'github.com/docker/docker/cmd/dockerd$' \
|
2017-03-31 13:32:13 +02:00
|
|
|
| grep -v 'github.com/docker/docker/pkg/integration$' \
|
2017-08-11 14:09:59 +02:00
|
|
|
%if ! 0%{?with_libseccomp}
|
|
|
|
| grep -v 'github.com/docker/docker/profiles/seccomp$' \
|
2017-03-31 13:32:13 +02:00
|
|
|
%endif
|
2017-08-11 14:09:59 +02:00
|
|
|
)
|
2016-08-23 16:44:42 +02:00
|
|
|
|
2017-10-18 06:27:06 +02:00
|
|
|
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
|
2016-08-23 16:44:42 +02:00
|
|
|
|
2014-07-17 17:31:28 +02:00
|
|
|
%install
|
|
|
|
install -d %{buildroot}%{go_contribdir}
|
|
|
|
install -d %{buildroot}%{_bindir}
|
2017-10-18 06:27:06 +02:00
|
|
|
install -D -m755 components/cli/build/docker %{buildroot}/%{_bindir}/docker
|
|
|
|
install -D -m755 components/engine/bundles/latest/dynbinary-daemon/dockerd %{buildroot}/%{_bindir}/dockerd
|
2014-07-17 17:31:28 +02:00
|
|
|
install -d %{buildroot}/%{_prefix}/lib/docker
|
2016-08-23 16:44:42 +02:00
|
|
|
install -Dd -m 0755 \
|
2017-10-18 06:27:06 +02:00
|
|
|
%{buildroot}%{_sysconfdir}/init.d \
|
|
|
|
%{buildroot}%{_sbindir}
|
2014-07-17 17:31:28 +02:00
|
|
|
|
2017-10-18 06:27:06 +02:00
|
|
|
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}"
|
2015-06-10 10:16:24 +02:00
|
|
|
# copy all for the test package
|
2016-06-21 12:05:57 +02:00
|
|
|
install -d %{buildroot}%{_prefix}/src/docker/
|
2017-10-18 06:27:06 +02:00
|
|
|
cp -a components/engine/. %{buildroot}%{_prefix}/src/docker/engine
|
|
|
|
cp -a components/cli/. %{buildroot}%{_prefix}/src/docker/cli
|
2014-07-17 17:31:28 +02:00
|
|
|
|
|
|
|
#
|
|
|
|
# systemd service
|
|
|
|
#
|
2016-06-21 12:05:57 +02:00
|
|
|
install -D -m 0644 %{SOURCE1} %{buildroot}%{_unitdir}/%{name}.service
|
|
|
|
ln -sf service %{buildroot}%{_sbindir}/rcdocker
|
2014-07-17 17:31:28 +02:00
|
|
|
|
|
|
|
#
|
|
|
|
# udev rules that prevents dolphin to show all docker devices and slows down
|
|
|
|
# upstream report https://bugs.kde.org/show_bug.cgi?id=329930
|
|
|
|
#
|
2016-06-21 12:05:57 +02:00
|
|
|
install -D -m 0644 %{SOURCE3} %{buildroot}%{_udevrulesdir}/80-%{name}.rules
|
2014-07-17 17:31:28 +02:00
|
|
|
|
2015-12-23 11:57:20 +01:00
|
|
|
# audit rules
|
2016-06-21 12:05:57 +02:00
|
|
|
install -D -m 0640 %{SOURCE8} %{buildroot}%{_sysconfdir}/audit/rules.d/%{name}.rules
|
2015-12-23 11:57:20 +01:00
|
|
|
|
2014-07-17 17:31:28 +02:00
|
|
|
# sysconfig file
|
2016-06-21 12:05:57 +02:00
|
|
|
install -D -m 644 %{SOURCE4} %{buildroot}%{_localstatedir}/adm/fillup-templates/sysconfig.docker
|
2014-07-17 17:31:28 +02:00
|
|
|
|
2017-10-18 06:27:06 +02:00
|
|
|
# install manpages (using the ones from the engine)
|
2015-05-27 12:27:27 +02:00
|
|
|
install -d %{buildroot}%{_mandir}/man1
|
2017-10-18 06:27:06 +02:00
|
|
|
install -p -m 644 components/cli/man/man1/*.1 %{buildroot}%{_mandir}/man1
|
2015-05-27 12:27:27 +02:00
|
|
|
install -d %{buildroot}%{_mandir}/man5
|
2017-10-18 06:27:06 +02:00
|
|
|
install -p -m 644 components/cli/man/man5/Dockerfile.5 %{buildroot}%{_mandir}/man5
|
2016-09-14 12:14:05 +02:00
|
|
|
install -d %{buildroot}%{_mandir}/man8
|
2017-10-18 06:27:06 +02:00
|
|
|
install -p -m 644 components/cli/man/man8/*.8 %{buildroot}%{_mandir}/man8
|
2015-05-27 12:27:27 +02:00
|
|
|
|
2017-10-18 06:27:06 +02:00
|
|
|
install -D -m 0644 %{SOURCE50} %{buildroot}%{docker_migration_warnfile}
|
|
|
|
install -D -m 0644 %{SOURCE51} %{buildroot}%{docker_plugin_warnfile}
|
2016-08-09 11:44:19 +02:00
|
|
|
|
2015-07-22 17:00:07 +02:00
|
|
|
%fdupes %{buildroot}
|
|
|
|
|
2014-07-17 17:31:28 +02:00
|
|
|
%pre
|
2017-10-18 06:27:06 +02:00
|
|
|
# TODO: Remove this code in the near future.
|
2016-08-09 11:44:19 +02:00
|
|
|
# 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):
|
2017-10-18 06:27:06 +02:00
|
|
|
# 1. Check that %%{_localstatedir}/lib/docker actually exists (docker daemon has run).
|
2016-08-09 11:44:19 +02:00
|
|
|
# 2. Check that the migrator has *not* finished.
|
2017-10-18 06:27:06 +02:00
|
|
|
# 3. Check that %%{_localstatedir}/lib/docker/graph exists (this is a <=1.9.1 thing, but
|
2016-08-09 11:44:19 +02:00
|
|
|
# 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.
|
2017-05-25 10:24:46 +02:00
|
|
|
if [[ -x %{_bindir}/docker && -d "%{docker_store}" && -n "$(find "%{docker_graph}" -maxdepth 1 -type d 2>/dev/null | grep -Ev '_tmp|^%{docker_graph}$')" ]]; then
|
2016-08-09 11:44:19 +02:00
|
|
|
# Check if currently installed version of docker is old enough to need migration.
|
|
|
|
CURRENT_DOCKER_VERSION=$(docker -v | sed 's/^.*[^0-9]\([0-9]*\.[0-9]*\.[0-9]*\).*$/\1/')
|
|
|
|
# This variable will contain the current docker version if migration is needed otherwise it will contain the upgrade point.
|
|
|
|
# Next time the docker package needs to be upgraded without restarting the service increase the 1.10.1 to the new version.
|
|
|
|
NEED_UPGRADE_VERSION=$(echo -e "$CURRENT_DOCKER_VERSION\n%{last_migration_version}" | sort -V | head -1)
|
|
|
|
|
|
|
|
if [[ $CURRENT_DOCKER_VERSION == $NEED_UPGRADE_VERSION ]]; then
|
|
|
|
touch %{docker_migration_testfile}
|
|
|
|
fi
|
2016-03-15 12:35:05 +01:00
|
|
|
fi
|
|
|
|
|
2016-06-21 12:05:57 +02:00
|
|
|
getent group docker >/dev/null || groupadd -r docker
|
2016-12-21 10:44:20 +01:00
|
|
|
%service_add_pre %{name}.service
|
2014-07-17 17:31:28 +02:00
|
|
|
|
|
|
|
%post
|
2016-08-09 11:44:19 +02:00
|
|
|
if [ -e %{docker_migration_testfile} ]; then
|
2017-10-18 06:27:06 +02:00
|
|
|
cat %{docker_migration_warnfile} >> /var/adm/update-messages/docker-%{version}-%{release}
|
2016-08-09 11:44:19 +02:00
|
|
|
else
|
|
|
|
if [ -e %{docker_migration_warnfile} ]; then
|
|
|
|
rm %{docker_migration_warnfile}
|
|
|
|
fi
|
|
|
|
fi
|
2017-10-18 06:27:06 +02:00
|
|
|
|
|
|
|
# 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
|
2017-03-07 11:40:30 +01:00
|
|
|
if [ -e /var/lib/docker/plugins/plugins.json ];then
|
2017-10-18 06:27:06 +02:00
|
|
|
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
|
2017-03-07 11:40:30 +01:00
|
|
|
fi
|
2017-10-18 06:27:06 +02:00
|
|
|
|
2016-12-21 10:44:20 +01:00
|
|
|
%service_add_post %{name}.service
|
2014-07-17 17:31:28 +02:00
|
|
|
%{fillup_only -n docker}
|
|
|
|
|
|
|
|
%preun
|
2016-12-21 10:44:20 +01:00
|
|
|
%service_del_preun %{name}.service
|
2014-07-17 17:31:28 +02:00
|
|
|
|
|
|
|
%postun
|
2016-08-09 11:44:19 +02:00
|
|
|
if [ -e %{docker_migration_testfile} ]; then
|
|
|
|
rm %{docker_migration_testfile}
|
|
|
|
export DISABLE_RESTART_ON_UPDATE=yes
|
|
|
|
fi
|
2016-12-21 10:44:20 +01:00
|
|
|
%service_del_postun %{name}.service
|
2014-07-17 17:31:28 +02:00
|
|
|
|
|
|
|
%files
|
|
|
|
%defattr(-,root,root)
|
2017-10-18 06:27:06 +02:00
|
|
|
%doc components/engine/README.md components/engine/LICENSE README_SUSE.md CHANGELOG.md
|
2014-07-17 17:31:28 +02:00
|
|
|
%{_bindir}/docker
|
2016-08-23 16:44:42 +02:00
|
|
|
%{_bindir}/dockerd
|
2014-12-03 22:48:32 +01:00
|
|
|
%{_sbindir}/rcdocker
|
2016-06-21 12:05:57 +02:00
|
|
|
%{_libexecdir}/docker/
|
2014-07-17 17:31:28 +02:00
|
|
|
%{_unitdir}/%{name}.service
|
2015-12-23 11:57:20 +01:00
|
|
|
%config %{_sysconfdir}/audit/rules.d/%{name}.rules
|
2016-06-21 12:05:57 +02:00
|
|
|
%{_udevrulesdir}/80-%{name}.rules
|
|
|
|
%{_localstatedir}/adm/fillup-templates/sysconfig.docker
|
2016-08-09 11:44:19 +02:00
|
|
|
%{_localstatedir}/lib/docker/
|
2016-06-21 12:05:57 +02:00
|
|
|
%{_mandir}/man1/docker-*.1%{ext_man}
|
|
|
|
%{_mandir}/man1/docker.1%{ext_man}
|
|
|
|
%{_mandir}/man5/Dockerfile.5%{ext_man}
|
2016-09-14 12:14:05 +02:00
|
|
|
%{_mandir}/man8/dockerd.8%{ext_man}
|
2014-07-17 17:31:28 +02:00
|
|
|
|
|
|
|
%files bash-completion
|
|
|
|
%defattr(-,root,root)
|
|
|
|
%config %{_sysconfdir}/bash_completion.d/%{name}
|
|
|
|
|
|
|
|
%files zsh-completion
|
|
|
|
%defattr(-,root,root)
|
|
|
|
%config %{_sysconfdir}/zsh_completion.d/%{name}
|
|
|
|
|
2015-06-10 10:16:24 +02:00
|
|
|
%files test
|
|
|
|
%defattr(-,root,root)
|
2016-06-21 12:05:57 +02:00
|
|
|
%{_prefix}/src/docker/
|
2015-07-10 13:27:13 +02:00
|
|
|
# exclude binaries
|
2017-10-18 06:27:06 +02:00
|
|
|
%exclude %{_prefix}/src/docker/engine/bundles/
|
|
|
|
%exclude %{_prefix}/src/docker/cli/build/
|
2015-07-10 13:27:13 +02:00
|
|
|
# exclude init configurations other than systemd
|
2017-10-18 06:27:06 +02:00
|
|
|
%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
|
2015-06-10 10:16:24 +02:00
|
|
|
|
2014-07-17 17:31:28 +02:00
|
|
|
%changelog
|