Skip to content
Draft
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ clean: clean-src ## remove build artifacts
deb rpm: checkout ## build rpm/deb packages
$(MAKE) -C $@ VERSION=$(VERSION) GO_VERSION=$(GO_VERSION) $@

.PHONY: centos-% fedora-% rhel-%
centos-% fedora-% rhel-%: checkout ## build rpm packages for the specified distro
.PHONY: centos-% fedora-% rhel-% opensuse-%
centos-% fedora-% rhel-% opensuse-%: checkout ## build rpm packages for the specified distro
$(MAKE) -C rpm VERSION=$(VERSION) GO_VERSION=$(GO_VERSION) $@

.PHONY: debian-% raspbian-% ubuntu-%
Expand Down
10 changes: 10 additions & 0 deletions distros.json
Original file line number Diff line number Diff line change
Expand Up @@ -141,5 +141,15 @@
"description": "Red Hat Enterprise Linux 10",
"end_of_life": "05-2035",
"end_of_support": "05-2030"
},
"opensuse-tumbleweed": {
"image": "registry.opensuse.org/opensuse/tumbleweed",
"arches": [
"amd64",
"aarch64"
],
"description": "openSUSE Tumbleweed",
"end_of_life": "12-2100",
"end_of_support": "12-2100"
}
}
12 changes: 11 additions & 1 deletion install-containerd-helpers
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,17 @@ function install_rpm_containerd() {
# so this logic works for both cases.
# (See also same logic in install_debian_containerd)

if command -v dnf5; then
if command -v zypper > /dev/null 2>&1; then
# openSUSE/SUSE uses zypper
zypper --version

zypper addrepo "${REPO_URL}" docker-ce
zypper --gpg-auto-import-keys refresh docker-ce
# Enable only the test repository
zypper modifyrepo --disable 'docker-ce-*'
zypper modifyrepo --enable 'docker-ce-test'
zypper refresh
elif command -v dnf5; then
dnf --version

# FIXME(thaJeztah); strip empty lines as workaround for https://github.com/rpm-software-management/dnf5/issues/1603
Expand Down
8 changes: 6 additions & 2 deletions rpm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,9 @@ RUN?=docker run --rm \
FEDORA_RELEASES ?= fedora-41 fedora-42 fedora-43
CENTOS_RELEASES ?= centos-9 centos-10
RHEL_RELEASES ?= rhel-8 rhel-9 rhel-10
OPENSUSE_RELEASES ?= opensuse-tumbleweed

DISTROS := $(FEDORA_RELEASES) $(CENTOS_RELEASES) $(RHEL_RELEASES)
DISTROS := $(FEDORA_RELEASES) $(CENTOS_RELEASES) $(RHEL_RELEASES) $(OPENSUSE_RELEASES)
BUNDLES := $(patsubst %,rpmbuild/bundles-ce-%-$(DPKG_ARCH).tar.gz,$(DISTROS))

.PHONY: help
Expand All @@ -82,7 +83,7 @@ clean: ## remove build artifacts
-docker builder prune -f --filter until=24h

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

.PHONY: fedora
fedora: $(FEDORA_RELEASES) ## build all fedora rpm packages
Expand All @@ -98,6 +99,9 @@ rhel: $(RHEL_RELEASES) ## build all rhel rpm packages
# each of the rhel-*/Dockerfile files.
$(RHEL_RELEASES): RPMBUILD_EXTRA_FLAGS += --define '_no_libnftables true'

.PHONY: opensuse
opensuse: $(OPENSUSE_RELEASES) ## build all opensuse rpm packages

.PHONY: $(DISTROS)
$(DISTROS): sources
@echo "== Building packages for $@ =="
Expand Down
4 changes: 4 additions & 0 deletions rpm/SPECS/docker-ce.spec
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,12 @@ Requires: (iptables-nft or iptables)
Requires: nftables
%if %{undefined rhel} || 0%{?rhel} < 9
# Libcgroup is no longer available in RHEL/CentOS >= 9 distros.
%if 0%{?suse_version}
Requires: libcgroup3
%else
Requires: libcgroup
%endif
%endif
Requires: containerd.io >= 1.7.27
Requires: tar
Requires: xz
Expand Down
27 changes: 27 additions & 0 deletions rpm/opensuse-tumbleweed/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# syntax=docker/dockerfile:1

ARG GO_IMAGE=golang:latest
ARG DISTRO=opensuse
ARG SUITE=tumbleweed
ARG BUILD_IMAGE=registry.opensuse.org/${DISTRO}/${SUITE}

FROM ${GO_IMAGE} AS golang

FROM ${BUILD_IMAGE}
ENV GOPROXY=https://proxy.golang.org|direct
ENV GO111MODULE=on
ENV GOPATH=/go
ENV GOTOOLCHAIN=local
ENV PATH=$PATH:/usr/local/go/bin:$GOPATH/bin
ENV AUTO_GOPATH=1
ARG DISTRO
ARG SUITE
ENV DISTRO=${DISTRO}
ENV SUITE=${SUITE}
RUN zypper install -y rpm-build

COPY --link SPECS /root/rpmbuild/SPECS
RUN zypper -n install -y --force-resolution $(rpmspec -q --buildrequires /root/rpmbuild/SPECS/*.spec)
COPY --link --from=golang /usr/local/go /usr/local/go
WORKDIR /root/rpmbuild
ENTRYPOINT ["/bin/rpmbuild"]
28 changes: 20 additions & 8 deletions verify
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,23 @@ function verify_rpm() {
DIST_ID=$(. /etc/os-release; echo "${ID}")
DIST_VERSION=$(. /etc/os-release; echo "${VERSION_ID}" | cut -d'.' -f1)

pkg_manager="yum"
pkg_config_manager="yum-config-manager"
if dnf --version; then
pkg_manager="dnf"
pkg_config_manager="dnf config-manager"
dnf clean all
${pkg_manager} install -y 'dnf-command(config-manager)'
fi
case ${DIST_ID} in
opensuse-tumbleweed)
pkg_manager="zypper"
DIST_VERSION="tumbleweed"
zypper clean -a
;;
*)
pkg_manager="yum"
pkg_config_manager="yum-config-manager"
if dnf --version; then
pkg_manager="dnf"
pkg_config_manager="dnf config-manager"
dnf clean all
${pkg_manager} install -y 'dnf-command(config-manager)'
fi
;;
esac

case ${DIST_ID}:${DIST_VERSION} in
ol:7*)
Expand All @@ -129,6 +138,9 @@ function verify_rpm() {
fedora*)
dnf install -y findutils
;;
opensuse*)
zypper install -y findutils
;;
esac

install_rpm_containerd
Expand Down