Skip to content

Commit be225e6

Browse files
nirmannarangprabhav-thali
authored andcommitted
Adds RHEL 8 and RHEL 9 support for s390x
Added Dockerfile for rhel-8. Modified rpm/Makefile to add support for rhel-8. Signed-off-by: Nirman Narang <[email protected]> Add RHEL 9 Dockerfile Signed-off-by: Prabhav Thali <[email protected]>
1 parent 396301b commit be225e6

File tree

3 files changed

+74
-3
lines changed

3 files changed

+74
-3
lines changed

rpm/Makefile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ SCAN_GITCOMMIT?=$(shell cd $(realpath $(CURDIR)/../src/github.com/docker/scan-cl
1313
BUILDX_GITCOMMIT?=$(shell cd $(realpath $(CURDIR)/../src/github.com/docker/buildx) && git rev-parse --short HEAD)
1414

1515
ifdef BUILD_IMAGE
16-
BUILD_IMAGE_FLAG=--build-arg $(BUILD_IMAGE)
16+
BUILD_IMAGE_FLAG=--build-arg BUILD_IMAGE=$(BUILD_IMAGE)
1717
endif
1818
BUILD?=DOCKER_BUILDKIT=1 \
1919
docker build \
@@ -61,7 +61,7 @@ RUN?=docker run --rm \
6161
FEDORA_RELEASES ?= fedora-37 fedora-36 fedora-35
6262
CENTOS_RELEASES ?= centos-7 centos-8 centos-9
6363
ifeq ($(ARCH),s390x)
64-
RHEL_RELEASES ?= rhel-7
64+
RHEL_RELEASES ?= rhel-7 rhel-8 rhel-9
6565
else
6666
RHEL_RELEASES ?=
6767
endif
@@ -80,7 +80,7 @@ clean: ## remove build artifacts
8080
-docker builder prune -f --filter until=24h
8181

8282
.PHONY: rpm
83-
rpm: fedora centos ## build all rpm packages
83+
rpm: fedora centos rhel ## build all rpm packages
8484

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

94+
.PHONY: rhel-8 rhel-9
95+
rhel-8 rhel-9: RPMBUILD_EXTRA_FLAGS=--define '_without_btrfs 1'
96+
9497
.PHONY: rhel
9598
rhel: $(RHEL_RELEASES) ## build all rhel rpm packages
9699

rpm/rhel-8/Dockerfile

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
ARG GO_IMAGE
2+
ARG DISTRO=rhel
3+
ARG SUITE=8
4+
ARG BUILD_IMAGE=dockereng/${DISTRO}:${SUITE}-s390x
5+
6+
FROM ${GO_IMAGE} AS golang
7+
8+
FROM ${BUILD_IMAGE}
9+
ENV GOPROXY=https://proxy.golang.org|direct
10+
ENV GO111MODULE=off
11+
ENV GOPATH=/go
12+
ENV PATH $PATH:/usr/local/go/bin:$GOPATH/bin
13+
ENV AUTO_GOPATH 1
14+
ENV DOCKER_BUILDTAGS exclude_graphdriver_btrfs
15+
ARG DISTRO
16+
ARG SUITE
17+
ENV DISTRO=${DISTRO}
18+
ENV SUITE=${SUITE}
19+
20+
RUN yum install -y rpm-build rpmlint libarchive yum-utils
21+
COPY SPECS /root/rpmbuild/SPECS
22+
23+
# TODO change once we support scan-plugin on other architectures
24+
RUN \
25+
if [ "$(uname -m)" = "x86_64" ]; then \
26+
yum-builddep --define '_without_btrfs 1' -y /root/rpmbuild/SPECS/*.spec; \
27+
else \
28+
yum-builddep --define '_without_btrfs 1' -y /root/rpmbuild/SPECS/docker-c*.spec; \
29+
yum-builddep --define '_without_btrfs 1' -y /root/rpmbuild/SPECS/docker-b*.spec; \
30+
fi
31+
32+
COPY --from=golang /usr/local/go /usr/local/go
33+
WORKDIR /root/rpmbuild
34+
ENTRYPOINT ["/bin/rpmbuild"]

rpm/rhel-9/Dockerfile

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
ARG GO_IMAGE
2+
ARG DISTRO=rhel
3+
ARG SUITE=9
4+
ARG BUILD_IMAGE=dockereng/${DISTRO}:${SUITE}-s390x
5+
6+
FROM ${GO_IMAGE} AS golang
7+
8+
FROM ${BUILD_IMAGE}
9+
ENV GOPROXY=https://proxy.golang.org|direct
10+
ENV GO111MODULE=off
11+
ENV GOPATH=/go
12+
ENV PATH $PATH:/usr/local/go/bin:$GOPATH/bin
13+
ENV AUTO_GOPATH 1
14+
ENV DOCKER_BUILDTAGS exclude_graphdriver_btrfs
15+
ARG DISTRO
16+
ARG SUITE
17+
ENV DISTRO=${DISTRO}
18+
ENV SUITE=${SUITE}
19+
20+
RUN yum install -y rpm-build rpmlint libarchive yum-utils
21+
COPY SPECS /root/rpmbuild/SPECS
22+
23+
# TODO change once we support scan-plugin on other architectures
24+
RUN \
25+
if [ "$(uname -m)" = "x86_64" ]; then \
26+
yum-builddep --define '_without_btrfs 1' -y /root/rpmbuild/SPECS/*.spec; \
27+
else \
28+
yum-builddep --define '_without_btrfs 1' -y /root/rpmbuild/SPECS/docker-c*.spec; \
29+
yum-builddep --define '_without_btrfs 1' -y /root/rpmbuild/SPECS/docker-b*.spec; \
30+
fi
31+
32+
COPY --from=golang /usr/local/go /usr/local/go
33+
WORKDIR /root/rpmbuild
34+
ENTRYPOINT ["/bin/rpmbuild"]

0 commit comments

Comments
 (0)