input/docker.spec
raw · 17.5 KiB
%define debug_package %{nil}
%define __os_install_post %{nil}
# RU: Должно совпадать с версией пакета.
# EN: Must be in sync with package version.
%define DOCKER_ENGINE_GITCOMMIT ecc6942
%define DOCKER_CLI_GITCOMMIT ecc6942
%define gopath_comp_engine github.com/docker/docker
%define gopath_comp_cli github.com/docker/cli
Name: docker
Version: 28.5.2
Release: 1%{?dist}
Summary: Docker
Summary(ru): Docker
License: Apache-2.0
URL: http://docs.docker.com
Source0: https://github.com/moby/moby/archive/refs/tags/v%{version}.tar.gz#moby-%{version}.tar.gz
Source2: https://github.com/docker/cli/archive/refs/tags/v%{version}.tar.gz#docker-cli-%{version}.tar.gz
Source3: docker-post19.service
Source4: docker-post19.socket
Source5: default-disable.preset
Source6: license.txt
# RU: Vendored Go dependencies for offline/reproducible build.
# EN: Vendored Go dependencies for offline/reproducible build.
Source100: docker-engine-vendor-%{version}.tar.xz
Source101: docker-cli-vendor-%{version}.tar.xz
Packager: NICE SOFT GROUP LLC (ООО "НАЙС СОФТ ГРУПП") 5024245440 <niceos@ncsgp.ru>
Vendor: NiceSOFT
Distribution: NiceOS.Core
BugURL: https://bugs.niceos.ru/
VCS: https://specs.niceos.ru/rmps/%{name}
BuildRequires: btrfs-progs-devel
BuildRequires: cmake
BuildRequires: device-mapper-devel
BuildRequires: glibc-devel
BuildRequires: go >= 1.23
BuildRequires: go-md2man
BuildRequires: jq
# BuildRequires: libapparmor-devel
BuildRequires: libgcc-devel
BuildRequires: libseccomp-devel
BuildRequires: libslirp-devel
BuildRequires: libtool-ltdl-devel
BuildRequires: sed
BuildRequires: slirp4netns
BuildRequires: systemd-devel
Requires: docker-cli = %{version}-%{release}
Requires: docker-engine = %{version}-%{release}
# RU: bash completion использует awk.
# EN: bash completion uses awk.
Requires: gawk
Requires: tini
%description
Docker is an open platform for building, shipping, and running applications as lightweight containers. Containers provide process isolation, improve portability across environments, and help use system resources efficiently. Docker standardizes build, test, and deployment workflows and is widely used in DevOps and CI/CD.
%description -l ru
Docker — это открытая платформа с открытым исходным кодом для разработки, доставки и запуска приложений в виде лёгких контейнеров. Контейнеры обеспечивают изоляцию, упрощают переносимость между разными средами и позволяют эффективно использовать ресурсы системы. С помощью Docker можно стандартизировать процесс сборки, тестирования и развертывания приложений, что делает его важным инструментом для DevOps и CI/CD.
%package engine
Summary: Docker Engine
Summary(ru): Движок Docker (Docker Engine)
Requires: containerd
Requires: device-mapper-libs
Requires: iptables
# Requires: libapparmor
Requires: libseccomp
Requires: libtool-ltdl
Requires: systemd
# 20.10 uses containerd v2 shim by default
Requires: /usr/bin/containerd-shim-runc-v2
%description engine
Docker Engine is the core daemon and runtime components responsible for creating, running, and managing containers. This subpackage provides systemd units and the required helper binaries for container lifecycle management, networking, and storage integration.
%description -l ru engine
Подпакет engine содержит основной движок Docker — компонент, который отвечает за создание, управление и выполнение контейнеров. В него входят системные службы и необходимые утилиты для запуска контейнеров, управления их жизненным циклом, сетями и хранилищем, а также взаимодействия через API.
%package cli
Summary: Docker CLI
Summary(ru): Командная строка Docker (Docker CLI)
Requires: glibc
Requires: libgcc
%description cli
Docker CLI provides the command-line interface for managing Docker. It can build and run containers, manage images, networks and volumes, and automate workflows through scripts and CI/CD systems.
%description -l ru cli
Подпакет cli предоставляет командный интерфейс (Command Line Interface) для управления Docker. С его помощью можно создавать, запускать, останавливать и удалять контейнеры, работать с образами, сетями и томами, а также автоматизировать операции в скриптах и CI/CD.
%package doc
Summary: Docker documentation and man pages
Summary(ru): Документация и man-страницы Docker
Requires: %{name} = %{version}-%{release}
%description doc
This subpackage contains offline documentation files shipped with Docker sources and the manual pages generated for the Docker CLI.
%description -l ru doc
Подпакет doc содержит офлайн-документацию из исходников Docker и man-страницы, сгенерированные для Docker CLI.
%package rootless
Summary: Rootless support for Docker
Summary(ru): Поддержка запуска Docker без прав суперпользователя
Requires: dbus-user-session
Requires: fuse
Requires: libslirp
Requires: rootlesskit
Requires: slirp4netns
Requires: %{name} = %{version}-%{release}
%description rootless
Rootless mode allows running the Docker daemon without root privileges. This subpackage provides helper scripts for launching and setting up rootless integration with systemd, improving security for multi-user environments.
%description -l ru rootless
Подпакет rootless позволяет запускать Docker без прав суперпользователя (rootless mode), что повышает безопасность системы и снижает риск выполнения потенциально опасных операций от имени root. Для запуска демона используется скрипт dockerd-rootless.sh, а для настройки интеграции с systemd — dockerd-rootless-setuptool.sh.
%prep
# RU: Использование autosetup здесь не подходит: пакет собирается в GOPATH-раскладке
# RU: из двух upstream-архивов: moby/moby и docker/cli.
# EN: autosetup is not suitable here: the package is built in GOPATH layout
# EN: from two upstream archives: moby/moby and docker/cli.
%setup -q -c -n moby-%{version}
pushd moby-%{version}
%autopatch -p1
popd
mkdir -p "$(dirname "src/%{gopath_comp_engine}")" \
"$(dirname "src/%{gopath_comp_cli}")" \
bin
mv moby-%{version} src/%{gopath_comp_engine}
pushd src/%{gopath_comp_engine}
# RU: man/go.mod мешает GOPATH-сборке/скриптам Docker.
# EN: man/go.mod interferes with GOPATH-style Docker build scripts.
rm -f man/go.mod
# RU: Распаковать vendored Go dependencies для Docker Engine.
# EN: Unpack vendored Go dependencies for Docker Engine.
rm -rf vendor
tar -xJf %{SOURCE100}
test -d vendor || {
echo "ERROR: Docker Engine vendor directory is missing"
exit 1
}
test -f vendor/modules.txt || {
echo "ERROR: Docker Engine vendor/modules.txt is missing"
exit 1
}
popd
tar -xf %{SOURCE2}
mv cli-%{version} src/%{gopath_comp_cli}
pushd src/%{gopath_comp_cli}
# RU: Docker CLI upstream использует vendor.mod/vendor.sum.
# RU: go.mod/go.sum нужны некоторым module-aware инструментам, даже если основная сборка идёт через GOPATH.
# EN: Docker CLI upstream uses vendor.mod/vendor.sum.
# EN: go.mod/go.sum are needed by some module-aware tools, even if the main build uses GOPATH.
cp -f vendor.mod go.mod
cp -f vendor.sum go.sum
# RU: Распаковать vendored Go dependencies для Docker CLI.
# EN: Unpack vendored Go dependencies for Docker CLI.
rm -rf vendor
tar -xJf %{SOURCE101}
test -d vendor || {
echo "ERROR: Docker CLI vendor directory is missing"
exit 1
}
test -f vendor/modules.txt || {
echo "ERROR: Docker CLI vendor/modules.txt is missing"
exit 1
}
popd
echo "Prepared Docker Engine vendor:"
ls -la src/%{gopath_comp_engine}/vendor/modules.txt
echo "Prepared Docker CLI vendor:"
ls -la src/%{gopath_comp_cli}/vendor/modules.txt
%build
export GOPATH="${PWD}"
export GO111MODULE=off
# RU: RPM build должен быть офлайн и не должен скачивать Go-модули или toolchain.
# EN: RPM build must be offline and must not download Go modules or toolchains.
export GOTOOLCHAIN=local
export GOPROXY=off
export GOSUMDB=off
export GONOSUMDB="*"
export GOPRIVATE="*"
# RU: Не задавать глобальный GOFLAGS=-mod=vendor при GO111MODULE=off.
# RU: Docker/Moby имеет собственные build scripts и vendor.mod/vendor.sum.
# EN: Do not set global GOFLAGS=-mod=vendor with GO111MODULE=off.
# EN: Docker/Moby has its own build scripts and vendor.mod/vendor.sum.
unset GOFLAGS
CONTAINERD_MIN_VER="1.2.0-beta.1"
BUILDTIME="$(date -u --rfc-3339 ns | sed -e 's/ /T/')"
PLATFORM="NiceSOFT NiceOS Docker Engine"
DEFAULT_PRODUCT_LICENSE="Community Engine"
ENGINE_IMAGE="engine-community"
# RU: Сборка CLI.
# EN: Build CLI.
pushd src/%{gopath_comp_cli}
DISABLE_WARN_OUTSIDE_CONTAINER=1 \
VERSION=%{version} \
BUILDTIME="$BUILDTIME" \
PLATFORM="$PLATFORM" \
GITCOMMIT=%{DOCKER_CLI_GITCOMMIT} \
make dynbinary manpages %{?_smp_mflags}
popd
# RU: Не используем trimpath (см. upstream issue в комментарии исходного spec).
# EN: Do not use trimpath for now (see upstream issue in the original spec comment).
#BUILDFLAGS="-gcflags=all=-trimpath=$GOPATH -asmflags=all=-trimpath=$GOPATH"
# RU: Сборка демона.
# EN: Build daemon.
pushd src/%{gopath_comp_engine}
VERSION=%{version} \
DOCKER_GITCOMMIT=%{DOCKER_ENGINE_GITCOMMIT} \
PRODUCT=docker \
BUILDTIME="$BUILDTIME" \
PLATFORM="$PLATFORM" \
DEFAULT_PRODUCT_LICENSE="$DEFAULT_PRODUCT_LICENSE" \
DOCKER_BUILDTAGS="seccomp selinux exclude_graphdriver_aufs" \
./hack/make.sh dynbinary
popd
jq -n \
--arg platform "$PLATFORM" \
--arg engine_image "$ENGINE_IMAGE" \
--arg containerd_min_ver "$CONTAINERD_MIN_VER" \
--arg runtime "host_install" \
'.platform = $platform | .engine_image = $engine_image | .containerd_min_version = $containerd_min_ver | .runtime = $runtime' \
> distribution_based_engine.json
%install
install -d -m 0755 %{buildroot}%{_bindir}
install -d -m 0755 %{buildroot}%{_datadir}/bash-completion/completions
install -d -m 0755 %{buildroot}%{_mandir}/man1
install -d -m 0755 %{buildroot}%{_mandir}/man5
install -d -m 0755 %{buildroot}%{_mandir}/man8
install -d -m 0755 %{buildroot}%{_sharedstatedir}/docker-engine
install -d -m 0755 %{buildroot}%{_udevrulesdir}
install -d -m 0755 %{buildroot}%{_unitdir}
# install binary
install -p -m 0755 src/%{gopath_comp_cli}/build/docker \
%{buildroot}%{_bindir}/docker
install -p -m 0755 src/%{gopath_comp_engine}/bundles/dynbinary-daemon/dockerd \
%{buildroot}%{_bindir}/dockerd
install -p -m 0755 src/%{gopath_comp_engine}/bundles/dynbinary-daemon/docker-proxy \
%{buildroot}%{_bindir}/docker-proxy
# RU: install tini (как в исходном spec, ссылка может быть "dangling" на этапе сборки).
# EN: install tini (kept as in the original spec; may be a dangling link at build time).
ln -s tini %{buildroot}%{_bindir}/docker-init
# install udev rules
install -p -m 0644 src/%{gopath_comp_engine}/contrib/udev/80-docker.rules \
%{buildroot}%{_udevrulesdir}/80-docker.rules
# add init scripts
install -p -m 0644 %{SOURCE3} %{buildroot}%{_unitdir}/docker.service
install -p -m 0644 %{SOURCE4} %{buildroot}%{_unitdir}/docker.socket
# add docker-engine metadata
install -p -m 0644 distribution_based_engine.json \
%{buildroot}%{_sharedstatedir}/docker-engine/distribution_based_engine.json
# add bash completions
install -p -m 0644 src/%{gopath_comp_cli}/contrib/completion/bash/docker \
%{buildroot}%{_datadir}/bash-completion/completions/docker
# install manpages
install -p -m 0644 src/%{gopath_comp_cli}/man/man1/*.1 %{buildroot}%{_mandir}/man1
install -p -m 0644 src/%{gopath_comp_cli}/man/man5/*.5 %{buildroot}%{_mandir}/man5
# RU: vim-файлы в upstream; здесь не устанавливаются (как в исходном spec).
# EN: Vim files are upstream; not installed here (as in the original spec).
mkdir -p build-docs
for engine_file in AUTHORS CONTRIBUTING.md LICENSE MAINTAINERS NOTICE README.md; do
cp "src/%{gopath_comp_engine}/$engine_file" "build-docs/engine-$engine_file"
done
for cli_file in AUTHORS LICENSE MAINTAINERS NOTICE README.md; do
cp "src/%{gopath_comp_cli}/$cli_file" "build-docs/cli-$cli_file"
done
install -v -D -m 0644 %{SOURCE5} %{buildroot}%{_presetdir}/50-docker.preset
# docker-rootless
install -D -p -m 0755 %{_builddir}/moby-%{version}/src/github.com/docker/docker/contrib/dockerd-rootless.sh \
%{buildroot}%{_bindir}/dockerd-rootless.sh
install -D -p -m 0755 %{_builddir}/moby-%{version}/src/github.com/docker/docker/contrib/dockerd-rootless-setuptool.sh \
%{buildroot}%{_bindir}/dockerd-rootless-setuptool.sh
%pre engine
if [ $1 -gt 0 ] ; then
# package upgrade scenario, before new files are installed
# clear any old state
rm -f %{_sharedstatedir}/rpm-state/docker-is-active > /dev/null 2>&1 || :
# check if docker service is running
if systemctl is-active docker.service > /dev/null 2>&1; then
systemctl stop docker > /dev/null 2>&1 || :
touch %{_sharedstatedir}/rpm-state/docker-is-active > /dev/null 2>&1 || :
fi
fi
%preun engine
%systemd_preun docker.service
%post engine
if [ $1 -eq 1 ] ; then
getent group docker >/dev/null || groupadd -r docker
fi
%systemd_post docker.service
%posttrans engine
if [ $1 -ge 0 ] ; then
# package upgrade scenario, after new files are installed
# check if docker was running before upgrade
if [ -f %{_sharedstatedir}/rpm-state/docker-is-active ]; then
systemctl start docker > /dev/null 2>&1 || :
rm -f %{_sharedstatedir}/rpm-state/docker-is-active > /dev/null 2>&1 || :
fi
fi
%clean
rm -rf %{buildroot}/*
%files
# RU: Мета-пакет без файлов; устанавливает зависимости на engine и cli.
# EN: Metapackage without files; pulls in engine and cli via dependencies.
%defattr(-,root,root)
%files engine
%defattr(-,root,root)
%{_bindir}/docker-init
%{_bindir}/docker-proxy
%{_bindir}/dockerd
%{_presetdir}/50-docker.preset
%{_sharedstatedir}/docker-engine/distribution_based_engine.json
%{_udevrulesdir}/80-docker.rules
%{_unitdir}/docker.service
%{_unitdir}/docker.socket
%files cli
%defattr(-,root,root)
%{_bindir}/docker
%{_datadir}/bash-completion/completions/docker
%files doc
%defattr(-,root,root)
%doc build-docs/engine-AUTHORS build-docs/engine-CONTRIBUTING.md build-docs/engine-LICENSE build-docs/engine-MAINTAINERS build-docs/engine-NOTICE build-docs/engine-README.md
%doc build-docs/cli-LICENSE build-docs/cli-MAINTAINERS build-docs/cli-NOTICE build-docs/cli-README.md
%doc
%{_mandir}/man1/*
%{_mandir}/man5/*
%files rootless
%defattr(-,root,root)
%{_bindir}/dockerd-rootless-setuptool.sh
%{_bindir}/dockerd-rootless.sh
%changelog
* Sat May 02 2026 NiceOS Team <support@niceos.ru> - 28.5.2-1
- EN: - Update docker to 28.5.2.
- Pull in runc security fixes for CVE-2025-31133, CVE-2025-52565, and CVE-2025-52881.
- Note upstream rootless change: dockerd-rootless.sh now tries pasta (passt) when slirp4netns is unavailable.
- Refresh source tarballs and package metadata for the new release.
- RU: - Обновить docker до 28.5.2.
- Подтянуть исправления безопасности runc для CVE-2025-31133, CVE-2025-52565 и CVE-2025-52881.
- Учесть изменение поведения rootless: dockerd-rootless.sh теперь пробует pasta (passt), если slirp4netns недоступен.
- Обновить исходные tarball-архивы и метаданные пакета под новый выпуск.
* Mon Mar 02 2026 NiceOS Team <niceos@ncsgp.ru> - 28.3.3-2
- Update docker.socket to use /run/docker.sock instead of legacy /var/run/docker.sock (systemd warning fix)
- Align Docker socket unit with modern runtime directory layout (/run)
- Improve socket activation behavior and reduce noisy systemd log messages
- Обновлён docker.socket: переход на /run/docker.sock вместо устаревшего /var/run/docker.sock (устранение предупреждений systemd)
- Приведён socket-юнит Docker к современной схеме runtime-директорий (/run)
- Улучшено поведение socket-активации и устранён шум в журналах systemd
* Sat Jan 10 2026 NiceOS Team <niceos@ncsgp.ru> - 28.3.3-1
- Initial build for NiceOS (Первая сборка для НАЙС.ОС)