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
|
|
|
#
|
2021-01-30 02:14:10 +01:00
|
|
|
# Copyright (c) 2021 SUSE LLC
|
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.
|
|
|
|
|
2018-12-20 12:23:52 +01:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2014-07-17 17:31:28 +02:00
|
|
|
#
|
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
|
|
|
|
2017-11-24 11:32:23 +01:00
|
|
|
# Where important update information will be stored, such that an administrator
|
|
|
|
# is guaranteed to see the relevant warning.
|
|
|
|
%define update_messages %{_localstatedir}/adm/update-messages/%{name}-%{version}-%{release}
|
|
|
|
|
2017-11-24 11:06:46 +01:00
|
|
|
#Compat macro for new _fillupdir macro introduced in Nov 2017
|
|
|
|
%if ! %{defined _fillupdir}
|
|
|
|
%define _fillupdir /var/adm/fillup-templates
|
|
|
|
%endif
|
|
|
|
|
2018-08-20 10:55:46 +02:00
|
|
|
# Handle _multibuild magic.
|
|
|
|
%define flavour @BUILD_FLAVOR@%{nil}
|
|
|
|
|
|
|
|
# We split the Name: into "realname" and "name_suffix".
|
|
|
|
%define realname docker
|
|
|
|
%if "%flavour" == ""
|
|
|
|
%define name_suffix %{nil}
|
|
|
|
%else
|
|
|
|
%define name_suffix -%{flavour}
|
|
|
|
%endif
|
|
|
|
|
2017-10-24 12:02:17 +02:00
|
|
|
# Used when generating the "build" information for Docker version. The value of
|
|
|
|
# git_commit_epoch is unused here (we use SOURCE_DATE_EPOCH, which rpm
|
|
|
|
# helpfully injects into our build environment from the changelog). If you want
|
|
|
|
# to generate a new git_commit_epoch, use this:
|
|
|
|
# $ date --date="$(git show --format=fuller --date=iso $COMMIT_ID | grep -oP '(?<=^CommitDate: ).*')" '+%s'
|
2022-06-07 09:53:36 +02:00
|
|
|
%define git_version a89b84221c85
|
|
|
|
%define git_commit_epoch 1654554758
|
2017-12-19 04:42:51 +01:00
|
|
|
|
2021-02-02 23:19:52 +01:00
|
|
|
# We require a specific pin of libnetwork because it doesn't really do
|
|
|
|
# versioning and minor version mismatches in libnetwork can break Docker
|
|
|
|
# networking. All other key runtime dependencies (containerd, runc) are stable
|
|
|
|
# enough that this isn't necessary.
|
2022-06-07 09:53:36 +02:00
|
|
|
%define libnetwork_version f6ccccb1c082a432c2a5814aaedaca56af33d9ea
|
2021-02-02 23:19:52 +01:00
|
|
|
|
|
|
|
%define dist_builddir %{_builddir}/dist-suse
|
|
|
|
%define cli_builddir %{dist_builddir}/src/github.com/docker/cli
|
|
|
|
%define proxy_builddir %{dist_builddir}/src/github.com/docker/libnetwork
|
2017-10-24 12:02:17 +02:00
|
|
|
|
2018-08-20 10:55:46 +02:00
|
|
|
Name: %{realname}%{name_suffix}
|
2022-06-07 09:53:36 +02:00
|
|
|
Version: 20.10.17_ce
|
2021-03-03 04:05:29 +01:00
|
|
|
# This "nice version" is so that docker --version gives a result that can be
|
|
|
|
# parsed by other people. boo#1182476
|
2022-06-07 09:53:36 +02:00
|
|
|
%define nice_version 20.10.17-ce
|
2014-07-17 17:31:28 +02:00
|
|
|
Release: 0
|
2019-05-03 18:22:55 +02:00
|
|
|
Summary: The Moby-project Linux container runtime
|
2014-07-17 17:31:28 +02:00
|
|
|
License: Apache-2.0
|
|
|
|
Group: System/Management
|
2019-11-18 05:55:57 +01:00
|
|
|
URL: http://www.docker.io
|
2019-05-03 18:22:55 +02:00
|
|
|
Source: %{realname}-%{version}_%{git_version}.tar.xz
|
2021-01-30 02:14:10 +01:00
|
|
|
Source1: %{realname}-cli-%{version}.tar.xz
|
2021-02-02 23:19:52 +01:00
|
|
|
Source2: %{realname}-libnetwork-%{libnetwork_version}.tar.xz
|
|
|
|
Source3: docker-rpmlintrc
|
2021-01-30 02:14:10 +01:00
|
|
|
# TODO: Move these source files to somewhere nicer.
|
|
|
|
Source100: docker.service
|
|
|
|
Source101: 80-docker.rules
|
|
|
|
Source102: sysconfig.docker
|
|
|
|
Source103: README_SUSE.md
|
|
|
|
Source104: docker-audit.rules
|
2021-02-02 23:19:52 +01:00
|
|
|
Source105: docker-daemon.json
|
2021-01-30 02:14:10 +01:00
|
|
|
# Kubelet-specific sources.
|
2018-08-20 10:55:46 +02:00
|
|
|
# bsc#1086185 -- but we only apply this on Kubic.
|
2021-01-30 02:14:10 +01:00
|
|
|
Source900: docker-kubic-service.conf
|
|
|
|
Source901: kubelet.env
|
|
|
|
# NOTE: All of these patches are maintained in <https://github.com/suse/docker>
|
|
|
|
# in the suse-<version> branch. Make sure you update the patches in that
|
|
|
|
# branch and then git-format-patch the patch here.
|
2016-10-11 12:30:52 +02:00
|
|
|
# SUSE-FEATURE: Adds the /run/secrets mountpoint inside all Docker containers
|
2021-02-01 03:36:37 +01:00
|
|
|
# which is not snapshotted when images are committed.
|
2021-02-02 23:19:52 +01:00
|
|
|
Patch100: 0001-SECRETS-daemon-allow-directory-creation-in-run-secre.patch
|
|
|
|
Patch101: 0002-SECRETS-SUSE-implement-SUSE-container-secrets.patch
|
2021-02-01 03:36:37 +01:00
|
|
|
# SUSE-FEATURE: Add support to mirror unofficial/private registries
|
|
|
|
# <https://github.com/docker/docker/pull/34319>.
|
2021-02-02 23:19:52 +01:00
|
|
|
Patch200: 0003-PRIVATE-REGISTRY-add-private-registry-mirror-support.patch
|
2021-01-30 02:14:10 +01:00
|
|
|
# SUSE-BACKPORT: Backport of https://github.com/docker/docker/pull/37353. bsc#1073877 bsc#1099277
|
2021-02-02 23:19:52 +01:00
|
|
|
Patch300: 0004-bsc1073877-apparmor-clobber-docker-default-profile-o.patch
|
2021-04-16 06:37:30 +02:00
|
|
|
# SUSE-BACKPORT: Backport of https://github.com/moby/moby/pull/42273. bsc#1183855 bsc#1175081
|
|
|
|
Patch301: 0005-bsc1183855-btrfs-Do-not-disable-quota-on-cleanup.patch
|
2022-04-29 05:40:42 +02:00
|
|
|
# SUSE-BACKPORT: Backport of several golang.org/x/crypto updates.
|
|
|
|
# bsc#1193930 CVE-2021-43565 bsc#1197284 CVE-2022-27191
|
|
|
|
Patch302: 0006-bsc1193930-vendor-update-golang.org-x-crypto.patch
|
2022-06-29 15:59:39 +02:00
|
|
|
# SUSE-BACKPORT: Backport of <https://github.com/containerd/fifo/pull/32>. bsc#1200022
|
|
|
|
Patch303: 0007-bsc1200022-fifo.Close-prevent-possible-panic-if-fifo.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
|
2019-03-11 01:44:36 +01:00
|
|
|
BuildRequires: fdupes
|
2014-08-01 11:48:31 +02:00
|
|
|
BuildRequires: libapparmor-devel
|
2014-07-17 17:31:28 +02:00
|
|
|
BuildRequires: libbtrfs-devel >= 3.8
|
2018-08-15 09:09:12 +02:00
|
|
|
BuildRequires: libseccomp-devel >= 2.2
|
2017-03-05 04:07:44 +01:00
|
|
|
BuildRequires: libtool
|
2014-07-17 17:31:28 +02:00
|
|
|
BuildRequires: procps
|
|
|
|
BuildRequires: sqlite3-devel
|
|
|
|
BuildRequires: zsh
|
2020-12-17 01:50:20 +01:00
|
|
|
BuildRequires: fish
|
2021-02-02 23:19:52 +01:00
|
|
|
BuildRequires: go-go-md2man
|
2020-06-03 13:37:56 +02:00
|
|
|
BuildRequires: pkgconfig(libsystemd)
|
2022-06-07 09:53:36 +02:00
|
|
|
# Due to a limitation in openSUSE's Go packaging we cannot have a BuildRequires
|
|
|
|
# for 'golang(API) >= 1.17' here, so just require 1.17 exactly. bsc#1172608
|
|
|
|
BuildRequires: go1.17
|
2022-09-29 09:47:00 +02:00
|
|
|
Requires: (apparmor-parser or container-selinux)
|
2014-07-17 17:31:28 +02:00
|
|
|
Requires: ca-certificates-mozilla
|
2021-02-02 23:19:52 +01:00
|
|
|
# The docker-proxy binary used to be in a separate package. We obsolete it,
|
|
|
|
# since now docker-proxy is maintained as part of this package.
|
|
|
|
Obsoletes: docker-libnetwork%{name_suffix} < 0.7.0.2
|
|
|
|
Provides: docker-libnetwork%{name_suffix} = 0.7.0.2.%{version}
|
|
|
|
# Required to actually run containers. We require the minimum version that is
|
|
|
|
# pinned by Docker, but in order to avoid headaches we allow for updates.
|
2022-06-07 09:53:36 +02:00
|
|
|
Requires: runc >= 1.1.2
|
|
|
|
Requires: containerd >= 1.6.6
|
2018-03-28 11:48:12 +02:00
|
|
|
# Needed for --init support. We don't use "tini", we use our own implementation
|
|
|
|
# which handles edge-cases better.
|
|
|
|
Requires: catatonit
|
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: 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
|
2022-09-29 10:58:41 +02:00
|
|
|
# This recommends is added to make sure that even if you have container-selinux
|
|
|
|
# installed you will still be prompted to install apparmor-parser which Docker
|
|
|
|
# requires to apply AppArmor profiles (for SELinux systems this doesn't matter
|
|
|
|
# but if you switch back to AppArmor on reboot this would result in insecure
|
|
|
|
# containers).
|
|
|
|
Recommends: apparmor-parser
|
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
|
2018-10-08 11:38:41 +02:00
|
|
|
Recommends: git-core >= 1.7
|
2017-12-19 04:42:51 +01:00
|
|
|
ExcludeArch: s390 ppc
|
2021-02-02 23:19:52 +01:00
|
|
|
|
2018-08-20 10:55:46 +02:00
|
|
|
# KUBIC-SPECIFIC: This was required when upgrading from the original kubic
|
|
|
|
# packaging, when everything was renamed to -kubic. It also is
|
|
|
|
# used to ensure that nothing complains too much when using
|
|
|
|
# -kubic packages. Hopfully it can be removed one day.
|
|
|
|
%if "%flavour" == "kubic"
|
|
|
|
# Obsolete old packege without the -kubic suffix
|
|
|
|
Obsoletes: %{realname} = 1.12.6
|
|
|
|
Obsoletes: %{realname}_1_12_6
|
|
|
|
# Conflict with non-kubic package, and provide equivalent
|
|
|
|
Conflicts: %{realname}
|
|
|
|
Provides: %{realname} = %{version}
|
2018-08-21 12:12:51 +02:00
|
|
|
# Kubernetes requires cri-runtime, which should be provided only by the -kubic flavour of this package
|
|
|
|
Provides: cri-runtime
|
2018-09-04 10:34:39 +02:00
|
|
|
# No i586 Kubernetes, so docker-kubic must not be built for i586 also
|
|
|
|
ExcludeArch: i586
|
2019-01-11 12:01:27 +01:00
|
|
|
# Disable leap based builds for kubic flavor (bsc#1121412)
|
|
|
|
%if 0%{?suse_version} == 1500 && 0%{?is_opensuse}
|
|
|
|
ExclusiveArch: do_not_build
|
|
|
|
%endif
|
2018-08-20 10:55:46 +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}
|
2019-02-09 14:55:16 +01:00
|
|
|
Group: System/Shells
|
2014-07-17 17:31:28 +02:00
|
|
|
Requires: %{name} = %{version}
|
2021-09-21 03:11:27 +02:00
|
|
|
Requires: bash-completion
|
2018-08-20 10:55:46 +02:00
|
|
|
Supplements: packageand(%{name}:bash-completion)
|
2014-07-17 17:31:28 +02:00
|
|
|
BuildArch: noarch
|
2018-08-20 10:55:46 +02:00
|
|
|
# KUBIC-SPECIFIC: This was required when upgrading from the original kubic
|
|
|
|
# packaging, when everything was renamed to -kubic. It also is
|
|
|
|
# used to ensure that nothing complains too much when using
|
|
|
|
# -kubic packages. Hopfully it can be removed one day.
|
|
|
|
%if "%flavour" == "kubic"
|
|
|
|
# Obsolete old packege without the -kubic suffix
|
|
|
|
Obsoletes: %{realname}-bash-completion = 1.12.6
|
|
|
|
# Conflict with non-kubic package, and provide equivalent
|
|
|
|
Conflicts: %{realname}-bash-completion > 1.12.6
|
|
|
|
Provides: %{realname}-bash-completion = %{version}
|
|
|
|
%endif
|
2014-07-17 17:31:28 +02:00
|
|
|
|
|
|
|
%description bash-completion
|
|
|
|
Bash command line completion support for %{name}.
|
|
|
|
|
|
|
|
%package zsh-completion
|
|
|
|
Summary: Zsh Completion for %{name}
|
2019-02-09 14:55:16 +01:00
|
|
|
Group: System/Shells
|
2014-07-17 17:31:28 +02:00
|
|
|
Requires: %{name} = %{version}
|
2021-09-21 03:11:27 +02:00
|
|
|
Requires: zsh
|
2018-08-20 10:55:46 +02:00
|
|
|
Supplements: packageand(%{name}:zsh)
|
2014-07-17 17:31:28 +02:00
|
|
|
BuildArch: noarch
|
2018-08-20 10:55:46 +02:00
|
|
|
# KUBIC-SPECIFIC: This was required when upgrading from the original kubic
|
|
|
|
# packaging, when everything was renamed to -kubic. It also is
|
|
|
|
# used to ensure that nothing complains too much when using
|
|
|
|
# -kubic packages. Hopfully it can be removed one day.
|
|
|
|
%if "%flavour" == "kubic"
|
|
|
|
# Obsolete old packege without the -kubic suffix
|
|
|
|
Obsoletes: %{realname}-zsh-completion = 1.12.6
|
|
|
|
# Conflict with non-kubic package, and provide equivalent
|
|
|
|
Conflicts: %{realname}-zsh-completion > 1.12.6
|
|
|
|
Provides: %{realname}-zsh-completion = %{version}
|
|
|
|
%endif
|
2014-07-17 17:31:28 +02:00
|
|
|
|
|
|
|
%description zsh-completion
|
|
|
|
Zsh command line completion support for %{name}.
|
|
|
|
|
2020-12-17 01:50:20 +01:00
|
|
|
%package fish-completion
|
|
|
|
Summary: Fish completion for %{name}
|
|
|
|
Group: System/Shells
|
|
|
|
Requires: %{name} = %{version}
|
2021-09-21 03:11:27 +02:00
|
|
|
Requires: fish
|
2020-12-17 01:50:20 +01:00
|
|
|
Supplements: packageand(%{name}:fish)
|
|
|
|
BuildArch: noarch
|
2020-12-23 07:43:09 +01:00
|
|
|
%if "%flavour" == "kubic"
|
|
|
|
# Conflict with non-kubic package, and provide equivalent
|
|
|
|
Conflicts: %{realname}-fish-completion
|
|
|
|
Provides: %{realname}-fish-completion = %{version}
|
|
|
|
%endif
|
2020-12-17 01:50:20 +01:00
|
|
|
|
|
|
|
%description fish-completion
|
|
|
|
Fish command line completion support for %{name}.
|
|
|
|
|
2018-08-21 12:12:51 +02:00
|
|
|
%if "%flavour" == "kubic"
|
|
|
|
%package kubeadm-criconfig
|
|
|
|
Summary: docker container runtime configuration for kubeadm
|
|
|
|
Group: System/Management
|
|
|
|
Requires: kubernetes-kubeadm
|
|
|
|
Requires(post): %fillup_prereq
|
|
|
|
Supplements: docker-kubic
|
|
|
|
Provides: kubernetes-kubeadm-criconfig
|
|
|
|
Conflicts: cri-o-kubeadm-criconfig
|
|
|
|
|
|
|
|
%description kubeadm-criconfig
|
|
|
|
docker container runtime configuration for kubeadm
|
|
|
|
%endif
|
|
|
|
|
2014-07-17 17:31:28 +02:00
|
|
|
%prep
|
2019-05-03 18:22:55 +02:00
|
|
|
%setup -q -n %{realname}-%{version}_%{git_version}
|
2021-01-30 02:14:10 +01:00
|
|
|
|
2016-04-15 12:21:32 +02:00
|
|
|
%if 0%{?is_opensuse}
|
|
|
|
# nothing
|
|
|
|
%else
|
2017-12-19 04:42:51 +01:00
|
|
|
# PATCH-SUSE: Secrets patches.
|
2021-01-30 02:14:10 +01:00
|
|
|
%patch100 -p1
|
|
|
|
%patch101 -p1
|
2016-04-15 12:21:32 +02:00
|
|
|
%endif
|
2018-08-20 10:55:46 +02:00
|
|
|
%if "%flavour" == "kubic"
|
|
|
|
# PATCH-SUSE: Mirror patch.
|
2021-01-30 02:14:10 +01:00
|
|
|
%patch200 -p1
|
2018-08-20 10:55:46 +02:00
|
|
|
%endif
|
2021-01-30 02:14:10 +01:00
|
|
|
# bsc#1099277
|
2021-02-02 23:19:52 +01:00
|
|
|
%patch300 -p1
|
2021-04-16 06:37:30 +02:00
|
|
|
# bsc#1183855 bsc#1175081
|
|
|
|
%patch301 -p1
|
2022-04-29 05:40:42 +02:00
|
|
|
# bsc#1193930 CVE-2021-43565 bsc#1197284 CVE-2022-27191
|
|
|
|
%patch302 -p1
|
2022-06-29 15:59:39 +02:00
|
|
|
# bsc#1200022
|
|
|
|
%patch303 -p1
|
2017-10-18 06:27:06 +02:00
|
|
|
|
2021-01-30 02:14:10 +01:00
|
|
|
# README_SUSE.md for documentation.
|
|
|
|
cp %{SOURCE103} .
|
|
|
|
|
2021-02-02 23:19:52 +01:00
|
|
|
# Extract the docker-cli source in a subdir.
|
|
|
|
mkdir -p %{cli_builddir}
|
|
|
|
pushd %{cli_builddir}
|
2021-01-30 02:14:10 +01:00
|
|
|
xz -dc %{SOURCE1} | tar -xof - --strip-components=1
|
2021-02-02 23:19:52 +01:00
|
|
|
popd
|
|
|
|
|
|
|
|
# Extract the docker-libnetwork source in a subdir.
|
|
|
|
mkdir -p %{proxy_builddir}
|
|
|
|
pushd %{proxy_builddir}
|
|
|
|
xz -dc %{SOURCE2} | tar -xof - --strip-components=1
|
2021-01-30 02:14:10 +01:00
|
|
|
popd
|
2019-03-10 22:59:21 +01:00
|
|
|
|
2014-07-17 17:31:28 +02:00
|
|
|
%build
|
2021-02-02 23:19:52 +01:00
|
|
|
echo "$PWD -- $PWD -- $PWD"
|
|
|
|
|
2018-08-15 09:09:12 +02:00
|
|
|
BUILDTAGS="exclude_graphdriver_aufs apparmor selinux seccomp pkcs11"
|
2017-07-27 18:11:06 +02:00
|
|
|
%if 0%{?sle_version} == 120000
|
2021-01-30 02:14:10 +01:00
|
|
|
# Allow us to build with older distros but still have deferred removal
|
|
|
|
# support at runtime. We only use this when building on SLE12, because
|
|
|
|
# later openSUSE/SLE versions have a new enough libdevicemapper to not
|
|
|
|
# require the runtime checking.
|
2017-12-18 13:28:20 +01:00
|
|
|
BUILDTAGS="libdm_dlsym_deferred_remove $BUILDTAGS"
|
2017-03-05 04:07:44 +01:00
|
|
|
%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"
|
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"
|
2017-10-24 12:02:17 +02:00
|
|
|
# Specify all of the versioning information. We use SOURCE_DATE_EPOCH if it's
|
|
|
|
# been injected by rpmbuild, otherwise we use the hardcoded git_commit_epoch
|
|
|
|
# generated above. boo#1064781
|
2021-03-03 04:05:29 +01:00
|
|
|
export VERSION="%{nice_version}"
|
2017-10-24 12:02:17 +02:00
|
|
|
export DOCKER_GITCOMMIT="%{git_version}"
|
|
|
|
export GITCOMMIT="%{git_version}"
|
|
|
|
export SOURCE_DATE_EPOCH="${SOURCE_DATE_EPOCH:-%{git_commit_epoch}}"
|
|
|
|
export BUILDTIME="$(date -u -d "@$SOURCE_DATE_EPOCH" --rfc-3339 ns 2>/dev/null | sed -e 's/ /T/')"
|
2021-10-06 05:17:02 +02:00
|
|
|
# NOTE: This will have to be removed with the next major Docker bump.
|
|
|
|
export GO111MODULE=off
|
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/
|
2021-02-02 23:19:52 +01:00
|
|
|
ln -s "%{cli_builddir}" "$PWD/src/github.com/docker/cli"
|
|
|
|
export GOPATH="$GOPATH:$PWD"
|
2016-01-20 19:58:55 +01:00
|
|
|
|
2019-03-10 22:20:43 +01:00
|
|
|
###################
|
|
|
|
## DOCKER ENGINE ##
|
|
|
|
###################
|
|
|
|
|
|
|
|
# Ignore the warning that we compile outside a Docker container.
|
2017-10-18 06:27:06 +02:00
|
|
|
./hack/make.sh dynbinary
|
2019-03-10 22:20:43 +01:00
|
|
|
|
|
|
|
###################
|
|
|
|
## DOCKER CLIENT ##
|
|
|
|
###################
|
|
|
|
|
2021-02-02 23:19:52 +01:00
|
|
|
pushd %{cli_builddir}
|
2021-04-16 06:37:30 +02:00
|
|
|
make dynbinary
|
2018-04-05 07:48:40 +02:00
|
|
|
|
|
|
|
mkdir -p ./man/man1
|
2018-04-10 11:09:40 +02:00
|
|
|
go build -buildmode=pie -o gen-manpages github.com/docker/cli/man
|
2021-02-02 23:19:52 +01:00
|
|
|
./gen-manpages --root "$PWD" --target "$PWD/man/man1"
|
2017-10-18 06:27:06 +02:00
|
|
|
./man/md2man-all.sh
|
2018-12-18 11:34:21 +01:00
|
|
|
popd
|
2014-07-17 17:31:28 +02:00
|
|
|
|
2021-02-02 23:19:52 +01:00
|
|
|
##################
|
|
|
|
## DOCKER PROXY ##
|
|
|
|
##################
|
2018-06-05 13:23:05 +02:00
|
|
|
|
2021-02-02 23:19:52 +01:00
|
|
|
pushd %{proxy_builddir}
|
|
|
|
GOPATH="%{dist_builddir}" \
|
|
|
|
go build -buildmode=pie -o docker-proxy github.com/docker/libnetwork/cmd/proxy
|
|
|
|
popd
|
|
|
|
|
|
|
|
# We verify that our libnetwork source is the correct version. This is done
|
|
|
|
# on-build to make sure that someone doing an update didn't miss anything.
|
|
|
|
grep 'LIBNETWORK_COMMIT:=%{libnetwork_version}' hack/dockerfile/install/proxy.installer
|
2017-12-19 04:42:51 +01:00
|
|
|
|
2014-07-17 17:31:28 +02:00
|
|
|
%install
|
2021-02-02 23:19:52 +01:00
|
|
|
install -Dd -m0755 \
|
2017-10-18 06:27:06 +02:00
|
|
|
%{buildroot}%{_sysconfdir}/init.d \
|
2021-02-02 23:19:52 +01:00
|
|
|
%{buildroot}%{_bindir} \
|
2017-10-18 06:27:06 +02:00
|
|
|
%{buildroot}%{_sbindir}
|
2014-07-17 17:31:28 +02:00
|
|
|
|
2021-02-02 23:19:52 +01:00
|
|
|
# docker daemon
|
|
|
|
install -D -m0755 bundles/dynbinary-daemon/dockerd %{buildroot}/%{_bindir}/dockerd
|
|
|
|
install -d %{buildroot}/%{_localstatedir}/lib/docker
|
|
|
|
# daemon.json config file
|
|
|
|
install -D -m0644 %{SOURCE105} %{buildroot}%{_sysconfdir}/docker/daemon.json
|
|
|
|
|
|
|
|
# docker cli
|
|
|
|
install -D -m0755 %{cli_builddir}/build/docker %{buildroot}/%{_bindir}/docker
|
|
|
|
install -D -m0644 %{cli_builddir}/contrib/completion/bash/docker "%{buildroot}%{_datarootdir}/bash-completion/completions/%{realname}"
|
|
|
|
install -D -m0644 %{cli_builddir}/contrib/completion/zsh/_docker "%{buildroot}%{_sysconfdir}/zsh_completion.d/_%{realname}"
|
|
|
|
install -D -m0644 %{cli_builddir}/contrib/completion/fish/docker.fish "%{buildroot}/%{_datadir}/fish/vendor_completions.d/%{realname}.fish"
|
|
|
|
|
|
|
|
# docker proxy
|
|
|
|
install -D -m0755 %{proxy_builddir}/docker-proxy %{buildroot}/%{_bindir}/docker-proxy
|
2019-03-10 22:20:43 +01:00
|
|
|
|
2014-07-17 17:31:28 +02:00
|
|
|
# systemd service
|
2021-01-30 02:14:10 +01:00
|
|
|
install -D -m0644 %{SOURCE100} %{buildroot}%{_unitdir}/%{realname}.service
|
2018-08-20 10:55:46 +02:00
|
|
|
%if "%flavour" == "kubic"
|
2021-01-30 02:14:10 +01:00
|
|
|
install -D -m0644 %{SOURCE900} %{buildroot}%{_unitdir}/%{realname}.service.d/90-kubic.conf
|
2018-08-20 10:55:46 +02:00
|
|
|
%endif
|
2016-06-21 12:05:57 +02:00
|
|
|
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
|
2021-02-02 23:19:52 +01:00
|
|
|
install -D -m0644 %{SOURCE101} %{buildroot}%{_udevrulesdir}/80-%{realname}.rules
|
2014-07-17 17:31:28 +02:00
|
|
|
|
2015-12-23 11:57:20 +01:00
|
|
|
# audit rules
|
2021-02-02 23:19:52 +01:00
|
|
|
install -D -m0640 %{SOURCE104} %{buildroot}%{_sysconfdir}/audit/rules.d/%{realname}.rules
|
2015-12-23 11:57:20 +01:00
|
|
|
|
2014-07-17 17:31:28 +02:00
|
|
|
# sysconfig file
|
2021-02-02 23:19:52 +01:00
|
|
|
install -D -m0644 %{SOURCE102} %{buildroot}%{_fillupdir}/sysconfig.docker
|
2019-02-07 10:04:01 +01: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
|
2021-02-02 23:19:52 +01:00
|
|
|
install -p -m0644 %{cli_builddir}/man/man1/*.1 %{buildroot}%{_mandir}/man1
|
2015-05-27 12:27:27 +02:00
|
|
|
install -d %{buildroot}%{_mandir}/man5
|
2021-02-02 23:19:52 +01:00
|
|
|
install -p -m0644 %{cli_builddir}/man/man5/Dockerfile.5 %{buildroot}%{_mandir}/man5
|
2016-09-14 12:14:05 +02:00
|
|
|
install -d %{buildroot}%{_mandir}/man8
|
2021-02-02 23:19:52 +01:00
|
|
|
install -p -m0644 %{cli_builddir}/man/man8/*.8 %{buildroot}%{_mandir}/man8
|
2019-03-12 08:51:12 +01:00
|
|
|
|
2018-08-21 12:12:51 +02:00
|
|
|
%if "%flavour" == "kubic"
|
|
|
|
# place kubelet.env in fillupdir (for kubeadm-criconfig)
|
2021-01-30 02:14:10 +01:00
|
|
|
sed -e 's-@LIBEXECDIR@-%{_libexecdir}-g' -i %{SOURCE901}
|
2021-02-02 23:19:52 +01:00
|
|
|
install -D -m0644 %{SOURCE901} %{buildroot}%{_fillupdir}/sysconfig.kubelet
|
2018-08-21 12:12:51 +02:00
|
|
|
%endif
|
|
|
|
|
2015-07-22 17:00:07 +02:00
|
|
|
%fdupes %{buildroot}
|
|
|
|
|
2014-07-17 17:31:28 +02:00
|
|
|
%pre
|
2019-07-30 07:44:55 +02:00
|
|
|
# /var/run/docker.sock group owner.
|
2016-06-21 12:05:57 +02:00
|
|
|
getent group docker >/dev/null || groupadd -r docker
|
2019-07-30 07:44:55 +02:00
|
|
|
|
|
|
|
# used for --userns-remap=default.
|
|
|
|
getent passwd dockremap >/dev/null || \
|
|
|
|
useradd -Ur -p '!' -s /bin/false -c 'docker --userns-remap=default' dockremap
|
2019-12-12 01:16:15 +01:00
|
|
|
|
|
|
|
# /etc/sub[ug]id should exist already (it's part of shadow-utils), but older
|
|
|
|
# distros don't have it. Docker just parses it and doesn't need any special
|
|
|
|
# shadow-utils helpers.
|
|
|
|
touch /etc/subuid /etc/subgid ||:
|
|
|
|
|
2019-07-30 07:44:55 +02:00
|
|
|
# "useradd -r" doesn't add sub[ug]ids so we manually add some. Hopefully there
|
|
|
|
# aren't any conflicts here, because usermod doesn't provide the same "get
|
|
|
|
# unusued range" feature that dockremap does.
|
2019-12-12 01:16:15 +01:00
|
|
|
grep -q '^dockremap:' /etc/subuid || \
|
|
|
|
usermod -v 100000000-200000000 dockremap &>/dev/null || \
|
|
|
|
echo "dockremap:100000000:100000001" >>/etc/subuid ||:
|
|
|
|
grep -q '^dockremap:' /etc/subgid || \
|
|
|
|
usermod -w 100000000-200000000 dockremap &>/dev/null || \
|
|
|
|
echo "dockremap:100000000:100000001" >>/etc/subgid ||:
|
2019-07-30 07:44:55 +02:00
|
|
|
|
2018-08-20 10:55:46 +02:00
|
|
|
%service_add_pre %{realname}.service
|
2014-07-17 17:31:28 +02:00
|
|
|
|
|
|
|
%post
|
2018-08-20 10:55:46 +02:00
|
|
|
%service_add_post %{realname}.service
|
2014-07-17 17:31:28 +02:00
|
|
|
%{fillup_only -n docker}
|
|
|
|
|
2018-08-21 12:12:51 +02:00
|
|
|
%if "%flavour" == "kubic"
|
|
|
|
%post kubeadm-criconfig
|
|
|
|
%fillup_only -n kubelet
|
|
|
|
%endif
|
|
|
|
|
2014-07-17 17:31:28 +02:00
|
|
|
%preun
|
2018-08-20 10:55:46 +02:00
|
|
|
%service_del_preun %{realname}.service
|
2014-07-17 17:31:28 +02:00
|
|
|
|
|
|
|
%postun
|
2018-08-20 10:55:46 +02:00
|
|
|
%service_del_postun %{realname}.service
|
2014-07-17 17:31:28 +02:00
|
|
|
|
|
|
|
%files
|
|
|
|
%defattr(-,root,root)
|
2022-01-21 06:32:10 +01:00
|
|
|
%doc README.md README_SUSE.md
|
2021-01-30 02:14:10 +01:00
|
|
|
%license LICENSE
|
2014-07-17 17:31:28 +02:00
|
|
|
%{_bindir}/docker
|
2016-08-23 16:44:42 +02:00
|
|
|
%{_bindir}/dockerd
|
2021-02-02 23:19:52 +01:00
|
|
|
%{_bindir}/docker-proxy
|
2014-12-03 22:48:32 +01:00
|
|
|
%{_sbindir}/rcdocker
|
2019-06-27 09:16:12 +02:00
|
|
|
%dir %{_localstatedir}/lib/docker/
|
|
|
|
|
2018-08-20 10:55:46 +02:00
|
|
|
%{_unitdir}/%{realname}.service
|
|
|
|
%if "%flavour" == "kubic"
|
|
|
|
%dir %{_unitdir}/%{realname}.service.d/
|
|
|
|
%{_unitdir}/%{realname}.service.d/90-kubic.conf
|
|
|
|
%endif
|
2019-06-27 09:16:12 +02:00
|
|
|
|
2019-02-26 13:18:18 +01:00
|
|
|
%dir %{_sysconfdir}/docker
|
2019-06-27 09:16:12 +02:00
|
|
|
%config(noreplace) %{_sysconfdir}/docker/daemon.json
|
|
|
|
%{_fillupdir}/sysconfig.docker
|
|
|
|
|
2018-08-20 10:55:46 +02:00
|
|
|
%config %{_sysconfdir}/audit/rules.d/%{realname}.rules
|
|
|
|
%{_udevrulesdir}/80-%{realname}.rules
|
2019-06-27 09:16:12 +02:00
|
|
|
|
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)
|
2019-07-20 17:54:08 +02:00
|
|
|
%{_datarootdir}/bash-completion/completions/%{realname}
|
2014-07-17 17:31:28 +02:00
|
|
|
|
|
|
|
%files zsh-completion
|
|
|
|
%defattr(-,root,root)
|
2019-11-18 14:49:09 +01:00
|
|
|
%{_sysconfdir}/zsh_completion.d/_%{realname}
|
2014-07-17 17:31:28 +02:00
|
|
|
|
2020-12-17 01:50:20 +01:00
|
|
|
%files fish-completion
|
|
|
|
%defattr(-,root,root)
|
|
|
|
%{_datadir}/fish/vendor_completions.d/%{realname}.fish
|
|
|
|
|
2018-08-21 12:12:51 +02:00
|
|
|
%if "%flavour" == "kubic"
|
|
|
|
%files kubeadm-criconfig
|
|
|
|
%defattr(-,root,root)
|
|
|
|
%{_fillupdir}/sysconfig.kubelet
|
|
|
|
%endif
|
|
|
|
|
2014-07-17 17:31:28 +02:00
|
|
|
%changelog
|