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-24 14:33:39 +02:00
|
|
|
# Check if go_arches is defined in the project configuration
|
|
|
|
# Otherwise, define it here
|
2016-08-25 14:04:09 +02:00
|
|
|
# In order to define it in the project configuration, see
|
2016-08-24 14:33:39 +02:00
|
|
|
#
|
2016-08-25 14:04:09 +02:00
|
|
|
# https://en.opensuse.org/openSUSE:Build%20Service%20prjconf#Macros
|
2016-08-24 14:33:39 +02:00
|
|
|
#
|
2016-08-25 14:04:09 +02:00
|
|
|
# The Macros tag is the one that defines the go_arches variable to be used
|
2016-08-24 14:33:39 +02:00
|
|
|
# in the spec file.
|
|
|
|
# The "define" one is to help the specfile parser of the buildservice
|
|
|
|
# to see what packages are being built. You also want to define it here
|
|
|
|
# for keeping things consistent.
|
|
|
|
|
2016-09-19 14:08:32 +02:00
|
|
|
%{!?go_arches: %global go_arches %ix86 x86_64 aarch64 ppc64le}
|
2016-08-24 14:33:39 +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
|
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-03-05 04:07:44 +01:00
|
|
|
%define version_unconverted 1.13.0
|
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-03-05 04:07:44 +01:00
|
|
|
Version: 1.13.0
|
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
|
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
|
2016-08-09 11:44:19 +02:00
|
|
|
Source9: docker-update-message.txt
|
2016-08-26 14:49:06 +02:00
|
|
|
Source10: tests.sh
|
2017-03-06 10:15:37 +01:00
|
|
|
Source11: docker_service_helper.sh
|
2016-08-23 16:44:42 +02:00
|
|
|
# Fixes for architecture-specific issues (gcc-go).
|
|
|
|
Patch100: gcc-go-patches.patch
|
|
|
|
Patch102: netlink_netns_powerpc.patch
|
2016-12-21 15:28:32 +01:00
|
|
|
Patch103: boltdb_bolt_add_brokenUnaligned.patch
|
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-03-17 14:18:51 +01:00
|
|
|
# PATCH-FIX-UPSTREAM: Backports.
|
2016-09-09 14:03:05 +02:00
|
|
|
Patch300: integration-cli-fix-TestInfoEnsureSucceeds.patch
|
2017-03-06 10:15:37 +01:00
|
|
|
Patch301: pr31549-cmd-docker-fix-TestDaemonCommand.patch
|
2017-03-17 14:18:51 +01:00
|
|
|
Patch302: pr31773-daemon-also-ensureDefaultApparmorProfile-in-exec-pat.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-03-05 04:07:44 +01:00
|
|
|
BuildRequires: libseccomp-devel
|
|
|
|
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-03-05 04:07:44 +01:00
|
|
|
Requires: docker-libnetwork = 0.0.0+git20161019.0f53435
|
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
|
|
|
|
# Dockerfile to ensure that we don't use a slightly incompatible version of
|
|
|
|
# runC or containerd (which would be bad).
|
2017-03-05 04:07:44 +01:00
|
|
|
Requires: containerd = 0.2.5+gitr608_03e5862
|
|
|
|
Requires: runc = 0.1.1+gitr2942_2f7393a
|
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: lvm2 >= 2.2.89
|
|
|
|
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
|
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
|
|
|
|
%ifarch %{go_arches}
|
|
|
|
BuildRequires: go >= 1.5
|
|
|
|
BuildRequires: go-go-md2man
|
|
|
|
%else
|
2016-08-23 16:44:42 +02:00
|
|
|
BuildRequires: gcc6-go >= 6.1
|
2016-06-21 12:05:57 +02:00
|
|
|
%endif
|
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
|
2015-06-10 10:16:24 +02:00
|
|
|
Requires: libapparmor-devel
|
|
|
|
Requires: libbtrfs-devel >= 3.8
|
|
|
|
Requires: procps
|
|
|
|
Requires: sqlite3-devel
|
2016-06-21 12:05:57 +02:00
|
|
|
%ifarch %{go_arches}
|
|
|
|
Requires: go >= 1.4
|
|
|
|
%else
|
2016-08-23 16:44:42 +02:00
|
|
|
Requires: gcc6-go >= 6.1
|
2016-06-21 12:05:57 +02:00
|
|
|
%endif
|
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
|
|
|
|
%patch200 -p1
|
2017-03-08 10:03:15 +01:00
|
|
|
%patch201 -p1
|
2016-04-15 12:21:32 +02:00
|
|
|
%endif
|
2016-06-21 12:05:57 +02:00
|
|
|
%ifnarch %{go_arches}
|
2016-08-23 16:44:42 +02:00
|
|
|
%patch100 -p1
|
2016-02-09 12:46:03 +01:00
|
|
|
%patch102 -p1
|
2016-12-21 15:28:32 +01:00
|
|
|
%patch103 -p1
|
2015-06-05 17:24:58 +02:00
|
|
|
%endif
|
2016-09-09 14:03:05 +02:00
|
|
|
%patch300 -p1
|
2017-03-06 10:15:37 +01:00
|
|
|
%patch301 -p1
|
2017-03-17 14:18:51 +01:00
|
|
|
%patch302 -p1
|
2014-08-16 15:38:01 +02:00
|
|
|
cp %{SOURCE7} .
|
2016-08-26 14:49:06 +02:00
|
|
|
cp %{SOURCE10} .
|
2014-07-17 17:31:28 +02:00
|
|
|
|
|
|
|
%build
|
2016-06-21 12:05:57 +02:00
|
|
|
%ifnarch %{go_arches}
|
2015-08-21 11:18:31 +02:00
|
|
|
tmphack=/tmp/dirty-hack
|
|
|
|
[ -e $tmphack ] && rm -rf $tmphack
|
|
|
|
mkdir $tmphack
|
2016-08-23 16:44:42 +02:00
|
|
|
ln -s %{_bindir}/go-6 $tmphack/go
|
2015-08-21 11:18:31 +02:00
|
|
|
export PATH=$tmphack:$PATH
|
2015-06-05 17:24:58 +02:00
|
|
|
%endif
|
|
|
|
|
2017-03-05 04:07:44 +01:00
|
|
|
# Note that these commands do not allow %%elseif.
|
|
|
|
# For versions equal to or below SLE12 && openSUSE_13.2 libdevmapper.h is not
|
|
|
|
# recent enough to define dm_task_deferred_remove(). (This is not true of
|
|
|
|
# SLE12_SP1 but we cannot distinguish it with this macro.)
|
|
|
|
BUILDTAGS="exclude_graphdriver_aufs apparmor seccomp selinux pkcs11"
|
|
|
|
%if 0%{?suse_version} <= 1320
|
|
|
|
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}
|
2015-06-10 10:16:24 +02:00
|
|
|
EOF
|
|
|
|
) > docker_build_env
|
|
|
|
. ./docker_build_env
|
2016-01-20 19:58:55 +01:00
|
|
|
|
2016-06-21 12:05:57 +02:00
|
|
|
%ifarch %{go_arches}
|
2016-01-20 19:58:55 +01:00
|
|
|
./hack/make.sh dynbinary
|
2015-06-22 11:09:23 +02:00
|
|
|
man/md2man-all.sh
|
2016-01-20 19:58:55 +01:00
|
|
|
%else
|
|
|
|
./hack/make.sh dyngccgo
|
2015-06-24 11:02:29 +02:00
|
|
|
%endif
|
2016-01-20 19:58:55 +01:00
|
|
|
|
2016-08-26 14:49:06 +02:00
|
|
|
# build the tests binary
|
|
|
|
GOPATH=$(pwd)/vendor:$(pwd)/.gopath/ go test \
|
|
|
|
-tags "$DOCKER_BUILDTAGS daemon autogen" \
|
|
|
|
-c github.com/docker/docker/integration-cli -o tests.main
|
|
|
|
|
2015-06-10 10:16:24 +02:00
|
|
|
# remove other than systemd
|
|
|
|
# otherwise the resulting package will have extra requires
|
2015-06-22 11:09:23 +02:00
|
|
|
rm -rf hack/make/.build-deb
|
2014-07-17 17:31:28 +02:00
|
|
|
|
2016-08-23 16:44:42 +02:00
|
|
|
%ifarch %go_arches
|
|
|
|
%check
|
|
|
|
. ./docker_build_env
|
|
|
|
|
|
|
|
# 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.
|
|
|
|
cp -avr %{buildroot}/usr/src/%{name} $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.
|
|
|
|
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[@]}" ... \
|
|
|
|
| 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$' \
|
|
|
|
| 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$' \
|
|
|
|
| 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/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/pkg/integration$')
|
|
|
|
|
2017-03-05 04:07:44 +01:00
|
|
|
go test -cover -ldflags -w -tags "$DOCKER_BUILDTAGS" -a -test.timeout=10m $PKG_LIST
|
2016-08-23 16:44:42 +02:00
|
|
|
%endif
|
|
|
|
|
2014-07-17 17:31:28 +02:00
|
|
|
%install
|
|
|
|
install -d %{buildroot}%{go_contribdir}
|
|
|
|
install -d %{buildroot}%{_bindir}
|
2016-06-21 12:05:57 +02:00
|
|
|
%ifarch %{go_arches}
|
2016-08-23 16:44:42 +02:00
|
|
|
install -D -m755 bundles/latest/dynbinary-client/%{name} %{buildroot}/%{_bindir}/%{name}
|
|
|
|
install -D -m755 bundles/latest/dynbinary-daemon/%{name}d %{buildroot}/%{_bindir}/%{name}d
|
2016-01-20 19:58:55 +01:00
|
|
|
%else
|
2016-08-23 16:44:42 +02:00
|
|
|
install -D -m755 bundles/latest/dyngccgo/%{name} %{buildroot}/%{_bindir}/%{name}
|
|
|
|
install -D -m755 bundles/latest/dyngccgo/%{name}d %{buildroot}/%{_bindir}/%{name}d
|
2016-01-20 19:58:55 +01:00
|
|
|
%endif
|
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 \
|
|
|
|
%{buildroot}%{_sysconfdir}/init.d \
|
|
|
|
%{buildroot}%{_sbindir}
|
2014-07-17 17:31:28 +02:00
|
|
|
|
2016-06-21 12:05:57 +02:00
|
|
|
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}"
|
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/
|
|
|
|
cp -av . %{buildroot}%{_prefix}/src/docker/
|
2016-08-26 14:49:06 +02:00
|
|
|
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)
|
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
|
2017-01-13 14:05:35 +01:00
|
|
|
install -D -m 0755 %{SOURCE11} %{buildroot}/%{_libexecdir}/docker/
|
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
|
|
|
|
2016-06-21 12:05:57 +02:00
|
|
|
%ifarch %{go_arches}
|
2015-05-27 12:27:27 +02:00
|
|
|
# install manpages
|
|
|
|
install -d %{buildroot}%{_mandir}/man1
|
2015-06-22 11:09:23 +02:00
|
|
|
install -p -m 644 man/man1/*.1 %{buildroot}%{_mandir}/man1
|
2015-05-27 12:27:27 +02:00
|
|
|
install -d %{buildroot}%{_mandir}/man5
|
2015-06-22 11:09:23 +02:00
|
|
|
install -p -m 644 man/man5/Dockerfile.5 %{buildroot}%{_mandir}/man5
|
2016-09-14 12:14:05 +02:00
|
|
|
install -d %{buildroot}%{_mandir}/man8
|
|
|
|
install -p -m 644 man/man8/*.8 %{buildroot}%{_mandir}/man8
|
2015-06-24 11:02:29 +02:00
|
|
|
%endif
|
2015-05-27 12:27:27 +02:00
|
|
|
|
2016-08-09 11:44:19 +02:00
|
|
|
install -D -m 0644 %{SOURCE9} %{buildroot}%{docker_migration_warnfile}
|
|
|
|
|
2015-07-22 17:00:07 +02:00
|
|
|
%fdupes %{buildroot}
|
|
|
|
|
2014-07-17 17:31:28 +02:00
|
|
|
%pre
|
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):
|
|
|
|
# 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
|
|
|
|
# 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.
|
2016-08-26 12:03:39 +02:00
|
|
|
if [[ -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
|
|
|
|
cp %{docker_migration_warnfile} /var/adm/update-messages/docker
|
|
|
|
else
|
|
|
|
if [ -e %{docker_migration_warnfile} ]; then
|
|
|
|
rm %{docker_migration_warnfile}
|
|
|
|
fi
|
|
|
|
fi
|
2017-03-07 11:40:30 +01:00
|
|
|
# If plugins.json is present, docker will fail to start
|
|
|
|
# https://github.com/docker/docker/releases/1.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
|
|
|
|
fi
|
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)
|
2014-08-16 15:38:01 +02:00
|
|
|
%doc README.md LICENSE README_SUSE.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
|
|
|
%ifarch %{go_arches}
|
|
|
|
%{_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}
|
2015-06-24 11:02:29 +02:00
|
|
|
%endif
|
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
|
2016-06-21 12:05:57 +02:00
|
|
|
%exclude %{_prefix}/src/docker/bundles/
|
2015-07-10 13:27:13 +02:00
|
|
|
# exclude init configurations other than systemd
|
2016-06-21 12:05:57 +02:00
|
|
|
%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
|
2015-06-10 10:16:24 +02:00
|
|
|
|
2014-07-17 17:31:28 +02:00
|
|
|
%changelog
|