Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't package runc for RHEL/CentOS >= 8 #272

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion rpm/containerd.spec
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,22 @@ AutoReq: no

Name: containerd.io
Provides: containerd
# For some reason on rhel >= 8 if we "provide" runc then it makes this package unsearchable
# On RHEL >= 8, runc is packaged by Red Hat so it won't be provided by this package.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be possible to generate runc rpm too, to override the Red Hat version?

cc @thaJeztah @kolyshkin WDYT?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why make a separate runc package when there already exist a native one? Isn't it better to use the OS version when there is one?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OS version is often outdated

%if %{undefined rhel} || 0%{?rhel} < 8
Provides: runc
%endif

# Obsolete packages
Obsoletes: containerd
%if %{undefined rhel} || 0%{?rhel} < 8
Obsoletes: runc
%endif

# Conflicting packages
Conflicts: containerd
%if %{undefined rhel} || 0%{?rhel} < 8
Conflicts: runc
%endif

Version: %{getenv:RPM_VERSION}
Release: %{getenv:RPM_RELEASE_VERSION}%{?dist}
Expand All @@ -51,7 +55,9 @@ URL: https://containerd.io
Source0: containerd
Source1: containerd.service
Source2: containerd.toml
%if %{undefined rhel} || 0%{?rhel} < 8
Source3: runc
%endif
# container-selinux isn't a thing in suse flavors
%if %{undefined suse_version}
# amazonlinux2 doesn't have container-selinux either
Expand All @@ -64,6 +70,9 @@ Requires: libseccomp
# and libseccomp is named libseccomp2
Requires: libseccomp2
%endif
%if 0%{?rhel} >= 8
Requires: runc
%endif
BuildRequires: make
BuildRequires: gcc
BuildRequires: systemd
Expand Down Expand Up @@ -98,10 +107,12 @@ fi
# symlink the go source path to our build directory
ln -s /go/src/%{import_path} %{_topdir}/BUILD

%if %{undefined rhel} || 0%{?rhel} < 8
if [ ! -d %{_topdir}/SOURCES/runc ]; then
# Copy over our source code from our gopath to our source directory
cp -rf /go/src/github.com/opencontainers/runc %{_topdir}/SOURCES/runc
fi
%endif
cd %{_topdir}/BUILD/


Expand All @@ -122,7 +133,9 @@ rm -f bin/containerd-stress
bin/containerd --version
bin/ctr --version

%if %{undefined rhel} || 0%{?rhel} < 8
GO111MODULE=auto make -C /go/src/github.com/opencontainers/runc BINDIR=%{_topdir}/BUILD/bin BUILDTAGS='seccomp apparmor selinux %{runc_nokmem}' runc install
%endif


%install
Expand Down