diff --git a/distros.json b/distros.json index 6ec7db0cd1..1508e50e2d 100644 --- a/distros.json +++ b/distros.json @@ -126,5 +126,15 @@ "description": "Red Hat Enterprise Linux 9", "end_of_life": "05-2032", "end_of_support": "05-2027" + }, + "rhel-10": { + "image": "registry.access.redhat.com/ubi10/ubi", + "arches": [ + "amd64", + "aarch64" + ], + "description": "Red Hat Enterprise Linux 10", + "end_of_life": "05-2035", + "end_of_support": "05-2030" } } diff --git a/rpm/Makefile b/rpm/Makefile index 98565f67ff..f2c7d9a2e4 100644 --- a/rpm/Makefile +++ b/rpm/Makefile @@ -66,7 +66,7 @@ RUN?=docker run --rm \ FEDORA_RELEASES ?= fedora-41 fedora-42 CENTOS_RELEASES ?= centos-9 centos-10 -RHEL_RELEASES ?= rhel-8 rhel-9 +RHEL_RELEASES ?= rhel-8 rhel-9 rhel-10 DISTROS := $(FEDORA_RELEASES) $(CENTOS_RELEASES) $(RHEL_RELEASES) BUNDLES := $(patsubst %,rpmbuild/bundles-ce-%-$(DPKG_ARCH).tar.gz,$(DISTROS)) diff --git a/rpm/rhel-10/Dockerfile b/rpm/rhel-10/Dockerfile new file mode 100644 index 0000000000..e25866ddc0 --- /dev/null +++ b/rpm/rhel-10/Dockerfile @@ -0,0 +1,45 @@ +# syntax=docker/dockerfile:1 + +ARG GO_IMAGE=golang:latest +ARG DISTRO=rhel +ARG SUITE=10 +ARG BUILD_IMAGE=registry.access.redhat.com/ubi10/ubi + +FROM ${GO_IMAGE} AS golang + +FROM ${BUILD_IMAGE} AS subscribed-image +RUN --mount=type=secret,id=rh-user --mount=type=secret,id=rh-pass <<-EOT + rm -f /etc/rhsm-host + + if [ ! -f /run/secrets/rh-user ] || [ ! -f /run/secrets/rh-pass ]; then + echo "Either RH_USER or RH_PASS is not set. Running build without subscription." + else + subscription-manager register \ + --username="$(cat /run/secrets/rh-user)" \ + --password="$(cat /run/secrets/rh-pass)" + + subscription-manager repos --enable codeready-builder-for-rhel-10-$(arch)-rpms + # dnf config-manager --set-enabled codeready-builder-for-rhel-10-$(arch)-rpms + fi +EOT + +FROM subscribed-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 +ENV DOCKER_BUILDTAGS=exclude_graphdriver_btrfs +ARG DISTRO +ARG SUITE +ENV DISTRO=${DISTRO} +ENV SUITE=${SUITE} + +RUN dnf install -y rpm-build +COPY --link SPECS /root/rpmbuild/SPECS +RUN dnf builddep -y /root/rpmbuild/SPECS/*.spec +COPY --link --from=golang /usr/local/go /usr/local/go +WORKDIR /root/rpmbuild +ENTRYPOINT ["/bin/rpmbuild"]