From f6112e0896d79e9ba9eec2a3b54c3f23d9ae85e0 Mon Sep 17 00:00:00 2001 From: Zbigniew Kostrzewa Date: Thu, 29 May 2025 12:56:33 +0200 Subject: [PATCH] Support RPM build for Rocky Linux 9 --- packaging/README.md | 1 + packaging/rpm/Makefile | 10 +++++++--- packaging/rpm/SPECS/cri-dockerd.spec | 3 +++ packaging/rpm/rockylinux-9/Dockerfile | 25 +++++++++++++++++++++++++ 4 files changed, 36 insertions(+), 3 deletions(-) create mode 100644 packaging/rpm/rockylinux-9/Dockerfile diff --git a/packaging/README.md b/packaging/README.md index 033eba728..a2bc95d0d 100644 --- a/packaging/README.md +++ b/packaging/README.md @@ -14,4 +14,5 @@ The scripts will build for this list of packages types: * RPM packages for Fedora 30 * RPM packages for Fedora 29 * RPM packages for CentOS 7 +* RPM packages for Rocky Linux 9 * TGZ and ZIP files with static binaries diff --git a/packaging/rpm/Makefile b/packaging/rpm/Makefile index 422f523f1..88cd24920 100644 --- a/packaging/rpm/Makefile +++ b/packaging/rpm/Makefile @@ -44,6 +44,7 @@ SOURCES=$(addprefix rpmbuild/SOURCES/, $(SOURCE_FILES)) FEDORA_RELEASES := fedora-36 fedora-35 CENTOS_RELEASES := +ROCKYLINUX_RELEASES := rockylinux-9 .PHONY: help help: ## show make targets @@ -55,7 +56,7 @@ clean: ## remove build artifacts $(RM) -r rpmbuild/ .PHONY: rpm -rpm: fedora centos ## build all rpm packages +rpm: fedora centos rockylinux ## build all rpm packages .PHONY: fedora fedora: $(FEDORA_RELEASES) ## build all fedora rpm packages @@ -63,8 +64,11 @@ fedora: $(FEDORA_RELEASES) ## build all fedora rpm packages .PHONY: centos centos: $(CENTOS_RELEASES) ## build all centos rpm packages -.PHONY: $(FEDORA_RELEASES) $(CENTOS_RELEASES) -$(FEDORA_RELEASES) $(CENTOS_RELEASES): $(SOURCES) +.PHONY: rockylinux +rockylinux: $(ROCKYLINUX_RELEASES) ## build all rocky rpm packages + +.PHONY: $(FEDORA_RELEASES) $(CENTOS_RELEASES) $(ROCKYLINUX_RELEASES) +$(FEDORA_RELEASES) $(CENTOS_RELEASES) $(ROCKYLINUX_RELEASES): $(SOURCES) @echo "${APP_DIR}" @echo "${VERSION}" @echo "$(shell ./gen-rpm-ver $(APP_DIR) $(VERSION))" diff --git a/packaging/rpm/SPECS/cri-dockerd.spec b/packaging/rpm/SPECS/cri-dockerd.spec index a5be5a1c5..ac5ca2e1b 100644 --- a/packaging/rpm/SPECS/cri-dockerd.spec +++ b/packaging/rpm/SPECS/cri-dockerd.spec @@ -25,8 +25,11 @@ Requires: (iptables or nftables) Requires: iptables %endif %if %{undefined suse_version} +%if %{undefined rhel} || 0%{?rhel} < 9 +# Libcgroup is no longer available in RHEL/CentOS >= 9 distros. Requires: libcgroup %endif +%endif Requires: containerd.io >= 1.2.2-3 Requires: tar Requires: xz diff --git a/packaging/rpm/rockylinux-9/Dockerfile b/packaging/rpm/rockylinux-9/Dockerfile new file mode 100644 index 000000000..7dcf765fa --- /dev/null +++ b/packaging/rpm/rockylinux-9/Dockerfile @@ -0,0 +1,25 @@ +ARG GO_IMAGE +ARG DISTRO=rockylinux +ARG SUITE=9 +ARG BUILD_IMAGE=${DISTRO}:${SUITE} + +FROM ${GO_IMAGE} AS golang + +FROM ${BUILD_IMAGE} +ARG DISTRO +ARG SUITE +ENV DISTRO=${DISTRO} +ENV SUITE=${SUITE} +ENV GOPROXY=direct +ENV GOPATH=/go +ENV PATH $PATH:/usr/local/go/bin:$GOPATH/bin +ENV AUTO_GOPATH 1 +ENV DOCKER_BUILDTAGS seccomp selinux +ENV RUNC_BUILDTAGS seccomp selinux +RUN yum install -y rpm-build rpmlint yum-utils +RUN dnf config-manager --set-enabled crb +COPY SPECS /root/rpmbuild/SPECS +RUN yum-builddep -y /root/rpmbuild/SPECS/*.spec +COPY --from=golang /usr/local/go /usr/local/go +WORKDIR /root/rpmbuild +ENTRYPOINT ["/bin/rpmbuild"]