Skip to content

Commit

Permalink
CORS-2797: images: move container images to RHEL 9
Browse files Browse the repository at this point in the history
Use RHEL 9 as a base for all our container images.
  • Loading branch information
r4f4 committed Mar 25, 2024
1 parent d7bdcdf commit 45419c4
Show file tree
Hide file tree
Showing 10 changed files with 34 additions and 43 deletions.
2 changes: 1 addition & 1 deletion .ci-operator.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
build_root_image:
name: release
namespace: openshift
tag: rhel-8-release-golang-1.21-openshift-4.16
tag: rhel-9-release-golang-1.21-openshift-4.16
4 changes: 2 additions & 2 deletions images/baremetal/Dockerfile.ci
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@

FROM registry.ci.openshift.org/ocp/4.16:installer-terraform-providers AS providers

FROM registry.ci.openshift.org/ocp/builder:rhel-8-golang-1.21-openshift-4.16 AS builder
FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.21-openshift-4.16 AS builder
ARG TAGS="libvirt baremetal"
WORKDIR /go/src/github.com/openshift/installer
COPY . .
COPY --from=providers /go/src/github.com/openshift/installer/terraform/bin/ terraform/bin/
RUN DEFAULT_ARCH="$(go env GOHOSTARCH)" hack/build.sh


FROM registry.ci.openshift.org/ocp/4.16:base
FROM registry.ci.openshift.org/ocp/4.16:base-rhel9
COPY --from=builder /go/src/github.com/openshift/installer/bin/openshift-install /bin/openshift-install

RUN dnf upgrade -y && \
Expand Down
10 changes: 5 additions & 5 deletions images/infrastructure-providers/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
FROM registry.ci.openshift.org/ocp/builder:rhel-8-golang-1.21-openshift-4.16 AS macbuilder
FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.21-openshift-4.16 AS macbuilder
WORKDIR /go/src/github.com/openshift/installer
COPY . .
RUN CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 make -C terraform

FROM registry.ci.openshift.org/ocp/builder:rhel-8-golang-1.21-openshift-4.16 AS macarmbuilder
FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.21-openshift-4.16 AS macarmbuilder
WORKDIR /go/src/github.com/openshift/installer
COPY . .
RUN CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 make -C terraform

FROM registry.ci.openshift.org/ocp/builder:rhel-8-golang-1.21-openshift-4.16 AS linuxbuilder
FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.21-openshift-4.16 AS linuxbuilder
WORKDIR /go/src/github.com/openshift/installer
COPY . .
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 make -C terraform

FROM registry.ci.openshift.org/ocp/builder:rhel-8-golang-1.21-openshift-4.16 AS linuxarmbuilder
FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.21-openshift-4.16 AS linuxarmbuilder
WORKDIR /go/src/github.com/openshift/installer
COPY . .
RUN CGO_ENABLED=0 GOOS=linux GOARCH=arm64 make -C terraform

FROM registry.ci.openshift.org/ocp/4.16:base
FROM registry.ci.openshift.org/ocp/4.16:base-rhel9
WORKDIR /go/src/github.com/openshift/installer
COPY --from=macbuilder /go/src/github.com/openshift/installer/terraform/bin/ terraform/bin/
COPY --from=macarmbuilder /go/src/github.com/openshift/installer/terraform/bin/ terraform/bin/
Expand Down
4 changes: 2 additions & 2 deletions images/installer-altinfra/Dockerfile.ci
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# solutions. Once all providers have alternate implementations, this image will
# not be needed.

FROM registry.ci.openshift.org/ocp/builder:rhel-8-golang-1.21-openshift-4.16 AS builder
FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.21-openshift-4.16 AS builder
ARG TAGS="altinfra"
ARG OPENSHIFT_INSTALL_CLUSTER_API=""
WORKDIR /go/src/github.com/openshift/installer
Expand All @@ -16,7 +16,7 @@ RUN DEFAULT_ARCH="$(go env GOHOSTARCH)" hack/build.sh
RUN go run -mod=vendor hack/build-coreos-manifest.go


FROM registry.ci.openshift.org/ocp/4.16:base
FROM registry.ci.openshift.org/ocp/4.16:base-rhel9
COPY --from=builder /go/src/github.com/openshift/installer/bin/openshift-install /bin/openshift-install
COPY --from=builder /go/src/github.com/openshift/installer/bin/manifests/ /manifests/
RUN mkdir /output && chown 1000:1000 /output
Expand Down
12 changes: 6 additions & 6 deletions images/installer-artifacts/Dockerfile.rhel
Original file line number Diff line number Diff line change
Expand Up @@ -3,41 +3,41 @@

FROM registry.ci.openshift.org/ocp/4.16:installer-terraform-providers AS providers

FROM registry.ci.openshift.org/ocp/builder:rhel-8-golang-1.21-openshift-4.16 AS macbuilder
FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.21-openshift-4.16 AS macbuilder
ARG TAGS=""
WORKDIR /go/src/github.com/openshift/installer
COPY . .
COPY --from=providers /go/src/github.com/openshift/installer/terraform/bin/darwin_amd64 terraform/bin/darwin_amd64
RUN GOOS=darwin GOARCH=amd64 DEFAULT_ARCH="$(go env GOHOSTARCH)" hack/build.sh

FROM registry.ci.openshift.org/ocp/builder:rhel-8-golang-1.21-openshift-4.16 AS macarmbuilder
FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.21-openshift-4.16 AS macarmbuilder
ARG TAGS=""
WORKDIR /go/src/github.com/openshift/installer
COPY . .
COPY --from=providers /go/src/github.com/openshift/installer/terraform/bin/darwin_arm64 terraform/bin/darwin_arm64
RUN GOOS=darwin GOARCH=arm64 DEFAULT_ARCH="$(go env GOHOSTARCH)" hack/build.sh

FROM registry.ci.openshift.org/ocp/builder:rhel-8-golang-1.21-openshift-4.16 AS linuxbuilder
FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.21-openshift-4.16 AS linuxbuilder
ARG TAGS=""
WORKDIR /go/src/github.com/openshift/installer
COPY . .
COPY --from=providers /go/src/github.com/openshift/installer/terraform/bin/linux_amd64 terraform/bin/linux_amd64
RUN GOOS=linux GOARCH=amd64 DEFAULT_ARCH="$(go env GOHOSTARCH)" hack/build.sh

FROM registry.ci.openshift.org/ocp/builder:rhel-8-golang-1.21-openshift-4.16 AS linuxarmbuilder
FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.21-openshift-4.16 AS linuxarmbuilder
ARG TAGS=""
WORKDIR /go/src/github.com/openshift/installer
COPY . .
COPY --from=providers /go/src/github.com/openshift/installer/terraform/bin/linux_arm64 terraform/bin/linux_arm64
RUN GOOS=linux GOARCH=arm64 DEFAULT_ARCH="$(go env GOHOSTARCH)" hack/build.sh

FROM registry.ci.openshift.org/ocp/builder:rhel-8-golang-1.21-openshift-4.16 AS builder
FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.21-openshift-4.16 AS builder
ARG TAGS=""
WORKDIR /go/src/github.com/openshift/installer
COPY . .
RUN go run -mod=vendor hack/build-coreos-manifest.go

FROM registry.ci.openshift.org/ocp/4.16:base
FROM registry.ci.openshift.org/ocp/4.16:base-rhel9
COPY --from=macbuilder /go/src/github.com/openshift/installer/bin/openshift-install /usr/share/openshift/mac/openshift-install
COPY --from=macarmbuilder /go/src/github.com/openshift/installer/bin/openshift-install /usr/share/openshift/mac_arm64/openshift-install
COPY --from=linuxbuilder /go/src/github.com/openshift/installer/bin/openshift-install /usr/share/openshift/linux_amd64/openshift-install
Expand Down
4 changes: 2 additions & 2 deletions images/installer/Dockerfile.ci
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

FROM registry.ci.openshift.org/ocp/4.16:installer-terraform-providers AS providers

FROM registry.ci.openshift.org/ocp/builder:rhel-8-golang-1.21-openshift-4.16 AS builder
FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.21-openshift-4.16 AS builder
ARG TAGS=""
WORKDIR /go/src/github.com/openshift/installer
COPY . .
Expand All @@ -12,7 +12,7 @@ RUN DEFAULT_ARCH="$(go env GOHOSTARCH)" hack/build.sh
RUN go run -mod=vendor hack/build-coreos-manifest.go


FROM registry.ci.openshift.org/ocp/4.16:base
FROM registry.ci.openshift.org/ocp/4.16:base-rhel9
COPY --from=builder /go/src/github.com/openshift/installer/bin/openshift-install /bin/openshift-install
COPY --from=builder /go/src/github.com/openshift/installer/bin/manifests/ /manifests/
RUN mkdir /output && chown 1000:1000 /output
Expand Down
13 changes: 6 additions & 7 deletions images/installer/Dockerfile.upi.ci
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

FROM registry.ci.openshift.org/ocp/4.16:installer-terraform-providers as providers

FROM registry.ci.openshift.org/ocp/builder:rhel-8-golang-1.21-openshift-4.16 AS builder
FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.21-openshift-4.16 AS builder
ARG TAGS=""
WORKDIR /go/src/github.com/openshift/installer
COPY . .
Expand All @@ -16,29 +16,28 @@ FROM quay.io/ocp-splat/govc:v0.30.7 as govc
FROM quay.io/multi-arch/yq:3.3.0 as yq3
FROM quay.io/multi-arch/yq:4.30.5 as yq4

FROM registry.ci.openshift.org/ocp/4.16:base
FROM registry.ci.openshift.org/ocp/4.16:base-rhel9
COPY --from=cli /usr/bin/oc /bin/oc
COPY --from=builder /go/src/github.com/openshift/installer/bin/openshift-install /bin/openshift-install
COPY --from=builder /go/src/github.com/openshift/installer/upi /var/lib/openshift-install/upi

COPY --from=govc /govc /bin/govc

RUN rpm --import https://packages.microsoft.com/keys/microsoft.asc && \
sh -c 'echo -e "[packages-microsoft-com-prod]\nname=packages-microsoft-com-prod\nbaseurl=https://packages.microsoft.com/rhel/8/prod\nenabled=1\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc" >/etc/yum.repos.d/microsoft-prod.repo' && \
sh -c 'echo -e "[google-cloud-cli]\nname=Google Cloud CLI\nbaseurl=https://packages.cloud.google.com/yum/repos/cloud-sdk-el8-x86_64\nenabled=1\ngpgcheck=1\nrepo_gpgcheck=1\ngpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg\n https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg" > /etc/yum.repos.d/google-cloud-sdk.repo'
sh -c 'echo -e "[packages-microsoft-com-prod]\nname=packages-microsoft-com-prod\nbaseurl=https://packages.microsoft.com/rhel/9/prod\nenabled=1\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc" >/etc/yum.repos.d/microsoft-prod.repo' && \
sh -c 'echo -e "[google-cloud-cli]\nname=Google Cloud CLI\nbaseurl=https://packages.cloud.google.com/yum/repos/cloud-sdk-el9-x86_64\nenabled=1\ngpgcheck=1\nrepo_gpgcheck=0\ngpgkey=https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg" > /etc/yum.repos.d/google-cloud-sdk.repo'

RUN yum update -y && \
yum install --setopt=tsflags=nodocs -y \
azure-cli-2.49.0-1.el8 \
azure-cli-2.49.0-1.el9 \
gettext \
google-cloud-cli-447.0.0-1 \
gzip \
jq \
unzip \
openssh-clients \
openssl \
python3-pyOpenSSL \
python2-pyyaml \
python3-pip \
python3-pyyaml \
bind-utils \
util-linux \
Expand Down
6 changes: 3 additions & 3 deletions images/libvirt/Dockerfile.ci
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

FROM registry.ci.openshift.org/ocp/4.16:installer-terraform-providers as providers

FROM registry.ci.openshift.org/ocp/builder:rhel-8-golang-1.21-openshift-4.16 AS builder
FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.21-openshift-4.16 AS builder
ARG TAGS="libvirt"
WORKDIR /go/src/github.com/openshift/installer
COPY . .
Expand All @@ -15,7 +15,7 @@ FROM registry.ci.openshift.org/ocp/4.16:cli as cli
FROM quay.io/multi-arch/yq:3.3.0 as yq3
FROM quay.io/multi-arch/yq:4.30.5 as yq4

FROM quay.io/centos/centos:stream
FROM quay.io/centos/centos:stream9
COPY --from=builder /go/src/github.com/openshift/installer/bin/openshift-install /bin/openshift-install
COPY --from=builder /go/src/github.com/openshift/installer/images/libvirt/mock-nss.sh /bin/mock-nss.sh
COPY --from=builder /go/src/github.com/openshift/installer/images/libvirt/google-cloud-sdk.repo /etc/yum.repos.d/google-cloud-sdk.repo
Expand All @@ -25,7 +25,7 @@ RUN yum update -y && \
yum install --setopt=tsflags=nodocs -y \
genisoimage \
gettext \
google-cloud-sdk-365.0.1 \
google-cloud-sdk \
libvirt-client \
libvirt-libs \
nss_wrapper \
Expand Down
7 changes: 3 additions & 4 deletions images/libvirt/google-cloud-sdk.repo
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
[google-cloud-sdk]
name=Google Cloud SDK
baseurl=https://packages.cloud.google.com/yum/repos/cloud-sdk-el8-x86_64
baseurl=https://packages.cloud.google.com/yum/repos/cloud-sdk-el9-x86_64
enabled=1
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg
https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
repo_gpgcheck=0
gpgkey=https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
15 changes: 4 additions & 11 deletions images/openstack/Dockerfile.ci
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# It builds an image containing the openshift-install command as well as the openstack cli.
FROM registry.ci.openshift.org/ocp/4.16:installer-terraform-providers as providers

FROM registry.ci.openshift.org/ocp/builder:rhel-8-golang-1.21-openshift-4.16 AS builder
FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.21-openshift-4.16 AS builder
ARG TAGS=""
WORKDIR /go/src/github.com/openshift/installer
COPY . .
Expand All @@ -11,7 +11,7 @@ RUN DEFAULT_ARCH="$(go env GOHOSTARCH)" hack/build.sh

FROM registry.ci.openshift.org/ocp/4.16:cli AS cli

FROM registry.ci.openshift.org/ocp/4.16:base
FROM registry.ci.openshift.org/ocp/4.16:base-rhel9
COPY --from=cli /usr/bin/oc /bin/oc
COPY --from=builder /go/src/github.com/openshift/installer/bin/openshift-install /bin/openshift-install
COPY --from=builder /go/src/github.com/openshift/installer/upi/openstack /var/lib/openshift-install/upi
Expand All @@ -20,21 +20,14 @@ COPY --from=builder /go/src/github.com/openshift/installer/hack/openstack/test-m

# Install Dependendencies for tests
# https://github.com/openshift/origin/blob/6114cbc507bf18890f009f16ee424a62007bc390/images/tests/Dockerfile.rhel
RUN yum install --setopt=tsflags=nodocs -y gettext make git gzip util-linux glibc-locale-source && \
RUN yum update -y && \
yum install --setopt=tsflags=nodocs -y gettext make git gzip util-linux glibc-locale-source python3-pip unzip jq nmap && \
yum clean all && rm -rf /var/cache/yum/* && \
localedef -c -f UTF-8 -i en_US en_US.UTF-8 && \
git config --system user.name test && \
git config --system user.email test@example.com && \
chmod g+w /etc/passwd

RUN yum update -y && \
yum install --setopt=tsflags=nodocs -y \
python38 unzip jq nmap && \
yum erase -y python36 && \
yum clean all && rm -rf /var/cache/yum/*

RUN python3 -m pip install --upgrade pip

# ansible 2.9 is EOL in September 2023, so we need to install ansible-core and get the collections from source
# until we have a package available.
RUN python3 -m pip install ansible-core
Expand Down

0 comments on commit 45419c4

Please sign in to comment.