Skip to content

Commit

Permalink
Add package for AlmaLinux EL compatible
Browse files Browse the repository at this point in the history
Should be compatible with CentOS and RHEL

Remove dependency for libcgroup, on .el9
  • Loading branch information
afbjorklund committed Dec 19, 2024
1 parent a5cb0ab commit b939aa1
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 4 deletions.
2 changes: 2 additions & 0 deletions packaging/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,6 @@ The scripts will build for this list of packages types:
* DEB packages for Debian 11 Bullseye
* RPM packages for Fedora 41
* RPM packages for Fedora 40
* RPM packages for AlmaLinux 9
* RPM packages for AlmaLinux 8
* TGZ and ZIP files with static binaries
12 changes: 8 additions & 4 deletions packaging/rpm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ SOURCES=$(addprefix rpmbuild/SOURCES/, $(SOURCE_FILES))

FEDORA_RELEASES := fedora-39 fedora-40
CENTOS_RELEASES :=
ALMALINUX_RELEASES := almalinux-8 almalinux-9

.PHONY: help
help: ## show make targets
Expand All @@ -55,16 +56,19 @@ clean: ## remove build artifacts
$(RM) -r rpmbuild/

.PHONY: rpm
rpm: fedora centos ## build all rpm packages
rpm: fedora centos almalinux ## build all rpm packages

.PHONY: fedora
fedora: $(FEDORA_RELEASES) ## build all fedora rpm packages

.PHONY: centos
centos: $(CENTOS_RELEASES) ## build all centos rpm packages
centos: $(CENTOS_RELEASES) ## build all centos stream rpm packages

.PHONY: $(FEDORA_RELEASES) $(CENTOS_RELEASES)
$(FEDORA_RELEASES) $(CENTOS_RELEASES): $(SOURCES)
.PHONY: almalinux
almalinux: $(ALMALINUX_RELEASES) ## build all almalinux rpm packages

.PHONY: $(FEDORA_RELEASES) $(CENTOS_RELEASES) $(ALMALINUX_RELEASES)
$(FEDORA_RELEASES) $(CENTOS_RELEASES) $(ALMALINUX_RELEASES): $(SOURCES)
@echo "${APP_DIR}"
@echo "${VERSION}"
@echo "$(shell ./gen-rpm-ver $(APP_DIR) $(VERSION))"
Expand Down
3 changes: 3 additions & 0 deletions packaging/rpm/SPECS/cri-dockerd.spec
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
24 changes: 24 additions & 0 deletions packaging/rpm/almalinux-8/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
ARG GO_IMAGE
ARG DISTRO=almalinux
ARG SUITE=8
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
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"]
24 changes: 24 additions & 0 deletions packaging/rpm/almalinux-9/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
ARG GO_IMAGE
ARG DISTRO=almalinux
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
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"]

0 comments on commit b939aa1

Please sign in to comment.