You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
docker-ce/SPECS/docker-ce.spec

156 lines
4.6 KiB

%global debug_package %{nil}
%global _version 27.2.1
%global _release 1
%global _origversion %{_version}
Name: docker-ce
Version: %{_version}
Release: %{_release}%{?dist}.inferit
Epoch: 3
Source0: engine.tgz
Source1: tini.tgz
Patch0: 01-rlimit_nofile-rhel7.patch
# MSVSphere
Patch100: 0001-MSVSphere-modify-tini.installer.patch
Summary: The open-source application container engine
Group: Tools/Docker
License: ASL 2.0
URL: https://www.docker.com
Requires: /usr/sbin/groupadd
Requires: docker-ce-cli
# CentOS 7 and RHEL 7 do not yet support weak dependencies
#
# Note that we're not using <= 7 here, to account for other RPM distros, such
# as Fedora, which would not have the rhel macro set (so default to 0).
%if 0%{?rhel} == 7
Requires: docker-ce-rootless-extras
%else
Recommends: docker-ce-rootless-extras
%endif
Requires: container-selinux >= 2:2.74
Requires: libseccomp >= 2.3
Requires: systemd
Requires: iptables
%if %{undefined rhel} || 0%{?rhel} < 9
# Libcgroup is no longer available in RHEL/CentOS >= 9 distros.
Requires: libcgroup
%endif
Requires: containerd.io >= 1.6.24
Requires: tar
Requires: xz
BuildRequires: bash
BuildRequires: ca-certificates
BuildRequires: cmake
BuildRequires: golang
BuildRequires: gcc
BuildRequires: git
BuildRequires: glibc-static
BuildRequires: libarchive
BuildRequires: libseccomp-devel
BuildRequires: libselinux-devel
BuildRequires: libtool
BuildRequires: libtool-ltdl-devel
BuildRequires: make
BuildRequires: pkgconfig
BuildRequires: pkgconfig(systemd)
BuildRequires: selinux-policy-devel
BuildRequires: systemd-devel
BuildRequires: tar
BuildRequires: which
BuildRequires: kernel-rpm-macros
# conflicting packages
Conflicts: docker
Conflicts: docker-io
Conflicts: docker-ee
# Obsolete packages
#Obsoletes: docker-ce-selinux
#Obsoletes: docker-engine-selinux
#Obsoletes: docker-engine
%description
Docker is a product for you to build, ship and run any application as a
lightweight container.
Docker containers are both hardware-agnostic and platform-agnostic. This means
they can run anywhere, from your laptop to the largest cloud compute instance
and everything in between - and they don't require you to use a particular
language, framework or packaging system. That makes them great building blocks
for deploying and scaling web apps, databases, and backend services without
depending on a particular stack or provider.
%prep
%setup -q -c -n src -a 0
%if 0%{?rhel} == 7
%patch -p1 -P 0
%endif
%patch100 -p1
%build
export DOCKER_GITCOMMIT=%{_gitcommit_engine}
mkdir -p ${RPM_BUILD_DIR}/go/src/github.com/docker
ln -snf ${RPM_BUILD_DIR}/src/engine ${RPM_BUILD_DIR}/go/src/github.com/docker/docker
pushd ${RPM_BUILD_DIR}/src/engine
export TMP_GOPATH="${RPM_BUILD_DIR}/go"
tar -xf %{SOURCE1} -C "$TMP_GOPATH"
TMP_GOPATH="${RPM_BUILD_DIR}/go" hack/dockerfile/install/install.sh tini
GOPATH="${RPM_BUILD_DIR}/go" VERSION=%{_origversion} PRODUCT=docker hack/make.sh dynbinary
popd
%check
ver="$(engine/bundles/dynbinary-daemon/dockerd --version)"; \
test "$ver" = "Docker version %{_origversion}, build %{_gitcommit_engine}" && echo "PASS: daemon version OK" || (echo "FAIL: daemon version ($ver) did not match" && exit 1)
%install
install -D -p -m 0755 $(readlink -f engine/bundles/dynbinary-daemon/dockerd) ${RPM_BUILD_ROOT}%{_bindir}/dockerd
install -D -p -m 0755 $(readlink -f engine/bundles/dynbinary-daemon/docker-proxy) ${RPM_BUILD_ROOT}%{_bindir}/docker-proxy
install -D -p -m 0755 $(readlink -f engine/bundles/dynbinary-daemon/docker-proxy) ${RPM_BUILD_ROOT}%{_bindir}/docker-proxy
install -D -p -m 0755 ${RPM_BUILD_DIR}/go/tini/docker-init ${RPM_BUILD_ROOT}%{_libexecdir}/docker/docker-init
# install systemd scripts
install -D -m 0644 engine/contrib/init/systemd/docker.service ${RPM_BUILD_ROOT}%{_unitdir}/docker.service
install -D -m 0644 engine/contrib/init/systemd/docker.socket ${RPM_BUILD_ROOT}%{_unitdir}/docker.socket
# create the config directory
mkdir -p ${RPM_BUILD_ROOT}/etc/docker
%files
%{_bindir}/dockerd
%{_bindir}/docker-proxy
%{_libexecdir}/docker/docker-init
%{_unitdir}/docker.service
%{_unitdir}/docker.socket
%dir /etc/docker
%post
%systemd_post docker.service
if ! getent group docker > /dev/null; then
groupadd --system docker
fi
%preun
%systemd_preun docker.service docker.socket
%postun
%systemd_postun_with_restart docker.service
%changelog
* Tue Sep 18 2024 Dmitry Samoylik <Dmitriy.Samoylik@softline.com> - 27.2.1-1.inferit
- Update to 27.2.1
* Tue Aug 06 2024 Arkady L. Shane <tigro@msvsphere-os.ru> - 3:27.1.1-1.inferit
- Update to 27.1.1
- Remove Vendor and Packages
* Wed Jul 17 2024 Sergey Cherevko <s.cherevko@msvsphere-os.ru> - 27.0.3-1.inferit
- Adapted for build under MSVSphere 9
- Rebuilt for MSVSphere 9.4