Skip to content

Commit

Permalink
Upgrade to UBI9
Browse files Browse the repository at this point in the history
  • Loading branch information
bdunne committed Feb 15, 2024
1 parent 67f1ab0 commit e842e89
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 25 deletions.
3 changes: 0 additions & 3 deletions bin/build
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

TAG=latest

ARCH=`uname -m`

RPM_BUILD_OPTIONS=${RPM_BUILD_OPTIONS:-""}
RPM_BUILD_IMAGE=${RPM_BUILD_IMAGE:-"manageiq/rpm_build:$TAG"}
RPM_PREFIX=${RPM_PREFIX:-"manageiq"}
Expand Down Expand Up @@ -63,7 +61,6 @@ pushd $IMAGE_DIR

cmd+=" --tag $REPO/manageiq-base:$TAG \
--pull \
--build-arg ARCH=$ARCH \
--build-arg RPM_PREFIX=$RPM_PREFIX"

if [ -n "$NO_CACHE" ]; then
Expand Down
38 changes: 18 additions & 20 deletions images/manageiq-base/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
FROM registry.access.redhat.com/ubi8/ubi
FROM registry.access.redhat.com/ubi9/ubi
MAINTAINER ManageIQ https://manageiq.org

ARG ARCH=x86_64
ARG LOCAL_RPM
ARG RELEASE_BUILD
ARG RPM_PREFIX=manageiq
Expand All @@ -26,34 +25,33 @@ RUN chmod -R g+w /etc/pki/ca-trust && \
chmod -R g+w /usr/share/pki/ca-trust-legacy

# Install dumb-init to be used as the entrypoint
RUN curl -L -o /usr/bin/dumb-init https://github.com/Yelp/dumb-init/releases/download/v1.2.2/dumb-init_1.2.2_${ARCH} && \
RUN ARCH=$(uname -m) && \
curl -L -o /usr/bin/dumb-init https://github.com/Yelp/dumb-init/releases/download/v1.2.2/dumb-init_1.2.2_${ARCH} && \
chmod +x /usr/bin/dumb-init

COPY rpms/* /tmp/rpms/
COPY container-assets/create_local_yum_repo.sh /
COPY container-assets/clean_dnf_rpm /usr/local/bin/

RUN dnf config-manager --setopt=tsflags=nodocs --setopt=install_weak_deps=False --save && \
if [ ${ARCH} != "s390x" ] ; then \
dnf -y --setopt=protected_packages= remove redhat-release && \
dnf -y remove *subscription-manager* && \
dnf -y install \
http://mirror.centos.org/centos/8-stream/BaseOS/${ARCH}/os/Packages/centos-stream-release-8.6-1.el8.noarch.rpm \
http://mirror.centos.org/centos/8-stream/BaseOS/${ARCH}/os/Packages/centos-stream-repos-8-6.el8.noarch.rpm \
http://mirror.centos.org/centos/8-stream/BaseOS/${ARCH}/os/Packages/centos-gpg-keys-8-6.el8.noarch.rpm && \
dnf config-manager --setopt=appstream*.exclude=*httpd*,mod_ssl --save \
; fi && \
RUN curl -L https://releases.ansible.com/ansible-runner/ansible-runner.el9.repo > /etc/yum.repos.d/ansible-runner.repo

RUN ARCH=$(uname -m) && \
dnf config-manager --setopt=tsflags=nodocs --setopt=install_weak_deps=False --save && \
dnf -y --setopt=protected_packages= remove redhat-release && \
dnf -y remove *subscription-manager* && \
dnf -y install \
httpd \
mod_ssl \
https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm \
https://rpm.manageiq.org/release/18-radjabov/el8/noarch/manageiq-release-18.0-1.el8.noarch.rpm && \
dnf -y update && \
dnf -y module enable postgresql:13 ruby:3.1 && \
http://mirror.stream.centos.org/9-stream/BaseOS/${ARCH}/os/Packages/centos-stream-release-9.0-24.el9.noarch.rpm \
http://mirror.stream.centos.org/9-stream/BaseOS/${ARCH}/os/Packages/centos-stream-repos-9.0-24.el9.noarch.rpm \
http://mirror.stream.centos.org/9-stream/BaseOS/${ARCH}/os/Packages/centos-gpg-keys-9.0-24.el9.noarch.rpm && \
dnf -y install \
https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm \
https://rpm.manageiq.org/release/18-radjabov/el9/noarch/manageiq-release-18.0-1.el9.noarch.rpm && \
if [[ "$RELEASE_BUILD" != "true" ]]; then dnf config-manager --enable manageiq-18-radjabov-nightly; fi && \
dnf config-manager --setopt=ubi-8-*.exclude=dracut*,net-snmp*,redhat-release* --save && \
if [[ "$LOCAL_RPM" = "true" ]]; then /create_local_yum_repo.sh; fi && \
dnf -y module enable ruby:3.1 && \
dnf -y install \
httpd \
mod_ssl \
${RPM_PREFIX}-pods \
python3-devel && \
clean_dnf_rpm && \
Expand Down
4 changes: 2 additions & 2 deletions lib/tasks/release.rake
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ namespace :release do
content = base_dockerfile.read
content.sub!(/^(ARG BUILD_REF=)\w+/, "\\1#{branch}")
content.sub!(%r{(/rpm.manageiq.org/release/)\d+-\w+}, "\\1#{rpm_repo_name}")
content.sub!(%r{(/el8/noarch/manageiq-release-)\d+\.\d+-\d+}, "\\1#{branch_number}.0-1")
content.sub!(%r{(/el\d/noarch/manageiq-release-)\d+\.\d+-\d+}, "\\1#{branch_number}.0-1")
content.sub!(/(manageiq-)\d+-\w+(-nightly)/, "\\1#{rpm_repo_name}\\2")
base_dockerfile.write(content)

Expand Down Expand Up @@ -135,7 +135,7 @@ namespace :release do
base_dockerfile = root.join("images", "manageiq-base", "Dockerfile")
content = base_dockerfile.read
content.sub!(%r{(/rpm.manageiq.org/release/)\d+-\w+}, "\\1#{rpm_repo_name}")
content.sub!(%r{(/el8/noarch/manageiq-release-)\d+\.\d+-\d+}, "\\1#{next_branch_number}.0-1")
content.sub!(%r{(/el\d/noarch/manageiq-release-)\d+\.\d+-\d+}, "\\1#{next_branch_number}.0-1")
content.sub!(/(manageiq-)\d+-\w+(-nightly)/, "\\1#{rpm_repo_name}\\2")
base_dockerfile.write(content)

Expand Down

0 comments on commit e842e89

Please sign in to comment.