-
Notifications
You must be signed in to change notification settings - Fork 145
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds RHEL 8 and RHEL 9 support for s390x #568
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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 | ||
Comment on lines
+20
to
+30
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Historically, CentOS and RHEL would be "roughly equivalent", while CentOS "stream" no longer has the exact same promises, this still somewhat applies. So I did a compare with the equivalent CentOS Dockerfile;
diff --git a/rpm/rhel-8/Dockerfile b/rpm/centos-8/Dockerfile
index ebe324d..b627d7f 100644
--- a/rpm/rhel-8/Dockerfile
+++ b/rpm/centos-8/Dockerfile
@@ -17,16 +17,27 @@ ARG SUITE
ENV DISTRO=${DISTRO}
ENV SUITE=${SUITE}
-RUN yum install -y rpm-build rpmlint libarchive yum-utils
+# In aarch64 (arm64) images, the altarch repo is specified as repository, but
+# failing, so replace the URL.
+RUN if [ -f /etc/yum.repos.d/CentOS-Stream-Sources.repo ]; then sed -i 's/altarch/centos/g' /etc/yum.repos.d/CentOS-Stream-Sources.repo; fi
+
+RUN if [ -f /etc/yum.repos.d/CentOS-Stream-PowerTools.repo ]; then sed -i 's/enabled=0/enabled=1/g' /etc/yum.repos.d/CentOS-Stream-PowerTools.repo; fi
+
+# RHEL8 / CentOS 8 changed behavior and no longer "rpm --import" or
+# "rpmkeys --import"as part of rpm package's %post scriplet. See
+# https://forums.centos.org/viewtopic.php?f=54&t=72574, and
+# https://access.redhat.com/solutions/3720351
+RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
+RUN dnf install -y rpm-build rpmlint dnf-plugins-core
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; \
+ dnf 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; \
+ dnf builddep --define '_without_btrfs 1' -y /root/rpmbuild/SPECS/docker-c*.spec; \
+ dnf builddep --define '_without_btrfs 1' -y /root/rpmbuild/SPECS/docker-b*.spec; \
fi
COPY --from=golang /usr/local/go /usr/local/go There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Yes, sure. We have switched to dnf and added the key import. Will update the PR with same.
For RHEL 8, For RHEL 9, To add and use these repositories, credentials are required. As suggested here, should we add a note regarding repos to be enabled? |
||
|
||
COPY --from=golang /usr/local/go /usr/local/go | ||
WORKDIR /root/rpmbuild | ||
ENTRYPOINT ["/bin/rpmbuild"] |
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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same for this one |
||
|
||
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 | ||
Comment on lines
+20
to
+30
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as the other one; if you're able to look if we need to / should be using There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes, I'll update the PR for this and notify. |
||
|
||
COPY --from=golang /usr/local/go /usr/local/go | ||
WORKDIR /root/rpmbuild | ||
ENTRYPOINT ["/bin/rpmbuild"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was a private image that we used internally for EE releases, but it's no longer maintained; can you change this to a public image (Red Hat's official RHEL image?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @thaJeztah, we tried using Red Hat's universal base image for RHEL-8 and RHEL-9. However, Red Hat's official RHEL image does not have a few packages like rpmlint, libtool-ltdl-devel, selinux-policy-devel. To install these packages, repos need to be enabled.
While building docker-ce binaries, we enable the required repos using Red Hat credentials. We can change the image to Red Hat's universal base image. And add a note regarding repos to be enabled.
Please share your thoughts on the same.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @thaJeztah, Any thoughts on the above?