Skip to content

Commit be450a0

Browse files
Don't package runc for RHEL/CentOS >= 8
Signed-off-by: Romain Geissler <romain.geissler@amadeus.com>
1 parent b79cc82 commit be450a0

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

dockerfiles/rpm.dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ RUN chown -R ${UID}:${GID} /archive /build
105105
#
106106
# NOTE: Installation of source-packages is not currently tested here.
107107
FROM distro-image AS verify-packages
108+
ARG BASE
108109
COPY scripts/.rpm-helpers /root/
109110
RUN . /root/.rpm-helpers; install_package createrepo
110111
RUN if [ -d "/etc/zypp/repos.d/" ]; then ln -s "/etc/zypp/repos.d" "/etc/yum.repos.d"; fi \
@@ -116,7 +117,8 @@ RUN createrepo /build \
116117
&& rm -rf /build/repodata
117118
RUN containerd --version
118119
RUN ctr --version
119-
RUN runc --version
120+
# Don't try to run runc on RHEL/CentOS as we don't package it anymore.
121+
RUN if [ "${BASE}" != "rhel" ] && [ "${BASE}" != "centos" ]; then runc --version; fi
120122

121123
FROM scratch AS packages
122124
COPY --from=build-packages /archive /archive

rpm/containerd.spec

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,22 @@ AutoReq: no
3030

3131
Name: containerd.io
3232
Provides: containerd
33-
# For some reason on rhel >= 8 if we "provide" runc then it makes this package unsearchable
33+
# On RHEL >= 8 OS, runc is packaged by Red Hat so it won't be provided by this package.
3434
%if 0%{?rhel} <= 7
3535
Provides: runc
3636
%endif
3737

3838
# Obsolete packages
3939
Obsoletes: containerd
40+
%if 0%{?rhel} <= 7
4041
Obsoletes: runc
42+
%endif
4143

4244
# Conflicting packages
4345
Conflicts: containerd
46+
%if 0%{?rhel} <= 7
4447
Conflicts: runc
48+
%endif
4549

4650
Version: %{getenv:RPM_VERSION}
4751
Release: %{getenv:RPM_RELEASE_VERSION}%{?dist}
@@ -51,7 +55,9 @@ URL: https://containerd.io
5155
Source0: containerd
5256
Source1: containerd.service
5357
Source2: containerd.toml
58+
%if 0%{?rhel} <= 7
5459
Source3: runc
60+
%endif
5561
# container-selinux isn't a thing in suse flavors
5662
%if %{undefined suse_version}
5763
# amazonlinux2 doesn't have container-selinux either
@@ -88,10 +94,12 @@ fi
8894
# symlink the go source path to our build directory
8995
ln -s /go/src/%{import_path} %{_topdir}/BUILD
9096

97+
%if 0%{?rhel} <= 7
9198
if [ ! -d %{_topdir}/SOURCES/runc ]; then
9299
# Copy over our source code from our gopath to our source directory
93100
cp -rf /go/src/github.com/opencontainers/runc %{_topdir}/SOURCES/runc
94101
fi
102+
%endif
95103
cd %{_topdir}/BUILD/
96104

97105

@@ -108,7 +116,9 @@ rm -f bin/containerd-stress
108116
bin/containerd --version
109117
bin/ctr --version
110118

119+
%if 0%{?rhel} <= 7
111120
GO111MODULE=auto make -C /go/src/github.com/opencontainers/runc BINDIR=%{_topdir}/BUILD/bin BUILDTAGS='seccomp apparmor selinux %{runc_nokmem}' runc install
121+
%endif
112122

113123

114124
%install

0 commit comments

Comments
 (0)