Skip to content

Commit

Permalink
Adds RHEL 8 and RHEL 9 support for s390x
Browse files Browse the repository at this point in the history
Added Dockerfile for rhel-8. Modified rpm/Makefile to add support for rhel-8.

Signed-off-by: Nirman Narang <narang@us.ibm.com>

Add RHEL 9 Dockerfile

Signed-off-by: Prabhav Thali <Prabhav.Thali1@ibm.com>
  • Loading branch information
nirmannarang authored and prabhav-thali committed Dec 2, 2022
1 parent 396301b commit be225e6
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 3 deletions.
9 changes: 6 additions & 3 deletions rpm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ SCAN_GITCOMMIT?=$(shell cd $(realpath $(CURDIR)/../src/github.com/docker/scan-cl
BUILDX_GITCOMMIT?=$(shell cd $(realpath $(CURDIR)/../src/github.com/docker/buildx) && git rev-parse --short HEAD)

ifdef BUILD_IMAGE
BUILD_IMAGE_FLAG=--build-arg $(BUILD_IMAGE)
BUILD_IMAGE_FLAG=--build-arg BUILD_IMAGE=$(BUILD_IMAGE)
endif
BUILD?=DOCKER_BUILDKIT=1 \
docker build \
Expand Down Expand Up @@ -61,7 +61,7 @@ RUN?=docker run --rm \
FEDORA_RELEASES ?= fedora-37 fedora-36 fedora-35
CENTOS_RELEASES ?= centos-7 centos-8 centos-9
ifeq ($(ARCH),s390x)
RHEL_RELEASES ?= rhel-7
RHEL_RELEASES ?= rhel-7 rhel-8 rhel-9
else
RHEL_RELEASES ?=
endif
Expand All @@ -80,7 +80,7 @@ clean: ## remove build artifacts
-docker builder prune -f --filter until=24h

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

.PHONY: fedora
fedora: $(FEDORA_RELEASES) ## build all fedora rpm packages
Expand All @@ -91,6 +91,9 @@ centos-8 centos-9: RPMBUILD_EXTRA_FLAGS=--define '_without_btrfs 1'
.PHONY: centos
centos: $(CENTOS_RELEASES) ## build all centos rpm packages

.PHONY: rhel-8 rhel-9
rhel-8 rhel-9: RPMBUILD_EXTRA_FLAGS=--define '_without_btrfs 1'

.PHONY: rhel
rhel: $(RHEL_RELEASES) ## build all rhel rpm packages

Expand Down
34 changes: 34 additions & 0 deletions rpm/rhel-8/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
ARG GO_IMAGE
ARG DISTRO=rhel
ARG SUITE=8
ARG BUILD_IMAGE=dockereng/${DISTRO}:${SUITE}-s390x

FROM ${GO_IMAGE} AS golang

FROM ${BUILD_IMAGE}
ENV GOPROXY=https://proxy.golang.org|direct
ENV GO111MODULE=off
ENV GOPATH=/go
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 yum install -y rpm-build rpmlint libarchive yum-utils
COPY SPECS /root/rpmbuild/SPECS

# TODO change once we support scan-plugin on other architectures
RUN \
if [ "$(uname -m)" = "x86_64" ]; then \
yum-builddep --define '_without_btrfs 1' -y /root/rpmbuild/SPECS/*.spec; \
else \
yum-builddep --define '_without_btrfs 1' -y /root/rpmbuild/SPECS/docker-c*.spec; \
yum-builddep --define '_without_btrfs 1' -y /root/rpmbuild/SPECS/docker-b*.spec; \
fi

COPY --from=golang /usr/local/go /usr/local/go
WORKDIR /root/rpmbuild
ENTRYPOINT ["/bin/rpmbuild"]
34 changes: 34 additions & 0 deletions rpm/rhel-9/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
ARG GO_IMAGE
ARG DISTRO=rhel
ARG SUITE=9
ARG BUILD_IMAGE=dockereng/${DISTRO}:${SUITE}-s390x

FROM ${GO_IMAGE} AS golang

FROM ${BUILD_IMAGE}
ENV GOPROXY=https://proxy.golang.org|direct
ENV GO111MODULE=off
ENV GOPATH=/go
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 yum install -y rpm-build rpmlint libarchive yum-utils
COPY SPECS /root/rpmbuild/SPECS

# TODO change once we support scan-plugin on other architectures
RUN \
if [ "$(uname -m)" = "x86_64" ]; then \
yum-builddep --define '_without_btrfs 1' -y /root/rpmbuild/SPECS/*.spec; \
else \
yum-builddep --define '_without_btrfs 1' -y /root/rpmbuild/SPECS/docker-c*.spec; \
yum-builddep --define '_without_btrfs 1' -y /root/rpmbuild/SPECS/docker-b*.spec; \
fi

COPY --from=golang /usr/local/go /usr/local/go
WORKDIR /root/rpmbuild
ENTRYPOINT ["/bin/rpmbuild"]

0 comments on commit be225e6

Please sign in to comment.