Skip to content

Commit

Permalink
Upgrade builder image to CentOS stream9
Browse files Browse the repository at this point in the history
  • Loading branch information
mayorova committed Jan 9, 2025
1 parent 42acfd9 commit 70a5ec1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 17 deletions.
8 changes: 4 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ store-log-artifacts: &store-log-artifacts
path: log
destination: log

npm-cache-key: &npm-cache-key stream8-{{ .Environment.CACHE_VERSION }}-node-modules-{{ checksum "yarn.lock" }}
bundle-cache-key: &bundle-cache-key stream8-{{ .Environment.CACHE_VERSION }}-bundler-gems-{{ arch }}-{{ checksum "Gemfile.lock" }}-{{ checksum "/tmp/db" }}
assets-cache-key: &assets-cache-key stream8-{{ .Environment.CACHE_VERSION }}-asset-cache-{{ checksum "tmp/assets_related_checksums" }}
npm-cache-key: &npm-cache-key stream9-{{ .Environment.CACHE_VERSION }}-node-modules-{{ checksum "yarn.lock" }}
bundle-cache-key: &bundle-cache-key stream9-{{ .Environment.CACHE_VERSION }}-bundler-gems-{{ arch }}-{{ checksum "Gemfile.lock" }}-{{ checksum "/tmp/db" }}
assets-cache-key: &assets-cache-key stream9-{{ .Environment.CACHE_VERSION }}-asset-cache-{{ checksum "tmp/assets_related_checksums" }}
oracle-libs-cache-key: &oracle-libs-cache-key ora1-{{ .Environment.CACHE_VERSION }}-oracle-libs-cache-{{ checksum "script/oracle/install-instantclient-packages.sh" }}

restore-npm-cache: &restore-npm-cache
Expand Down Expand Up @@ -88,7 +88,7 @@ attach-to-workspace: &attach-to-workspace
at: .

system-builder-ruby31: &system-builder-ruby31
image: quay.io/3scale/system-builder:stream8-ruby3.1
image: quay.io/3scale/system-builder:stream9
environment:
BUNDLE_FROZEN: true
BUNDLE_PATH: 'vendor/bundle'
Expand Down
20 changes: 7 additions & 13 deletions openshift/system/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM quay.io/centos/centos:stream8 as builder
FROM quay.io/centos/centos:stream9 as builder
WORKDIR /opt/system
ENV RUBY_MAJOR_VERSION=3 \
RUBY_MINOR_VERSION=1 \
Expand All @@ -10,10 +10,8 @@ ADD . ./
RUN cp config/examples/*.yml config/ \
&& cp openshift/system/config/* config/

RUN sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-* \
&& sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-* \
&& dnf -y --setopt=module_stream_switch=True module enable ruby:${RUBY_VERSION} nodejs:18 mysql:8.0 \
&& dnf install -y --setopt=skip_missing_names_on_install=False,tsflags=nodocs shared-mime-info make automake gcc gcc-c++ redhat-rpm-config postgresql rubygem-irb rubygem-rdoc ruby-devel nodejs libpq-devel mysql-devel gd-devel libxml2-devel libxslt-devel git 'dnf-command(download)' podman-catatonit \
RUN dnf -y --enablerepo=crb --setopt=module_stream_switch=True module enable ruby:${RUBY_VERSION} nodejs:18 \
&& dnf install -y --enablerepo=crb --setopt=skip_missing_names_on_install=False,tsflags=nodocs shared-mime-info make automake gcc gcc-c++ postgresql rubygem-irb rubygem-rdoc ruby-devel nodejs libpq-devel mysql-devel gd-devel libxml2-devel libxslt-devel git 'dnf-command(download)' cpio \
&& BUNDLER_VERSION=$(awk '/BUNDLED WITH/ { getline; print $1 }' Gemfile.lock) \
&& gem install --no-document bundler:$BUNDLER_VERSION \
&& bundle config build.nokogiri --use-system-libraries \
Expand All @@ -36,7 +34,7 @@ RUN cd /tmp \
&& ./autogen.sh && ./configure --libdir=/usr/local/lib64/ && make


FROM quay.io/centos/centos:stream8 AS base
FROM quay.io/centos/centos:stream9 AS base

USER root

Expand All @@ -52,18 +50,14 @@ ENV RUBY_VERSION="${RUBY_MAJOR_VERSION}.${RUBY_MINOR_VERSION}"

WORKDIR $HOME

RUN sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-* \
&& sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-* \
&& dnf -y module enable ruby:${RUBY_VERSION} nodejs:18 mysql:8.0 \
&& dnf install -y --setopt=skip_missing_names_on_install=False,tsflags=nodocs shared-mime-info postgresql rubygem-irb rubygem-rdoc ruby libpq mysql mysql-libs gd git liberation-sans-fonts file libxml2 libxslt \
RUN dnf -y --enablerepo=crb module enable ruby:${RUBY_VERSION} nodejs:18 \
&& dnf install -y --enablerepo=crb --setopt=skip_missing_names_on_install=False,tsflags=nodocs shared-mime-info postgresql rubygem-irb rubygem-rdoc ruby libpq mysql mysql-libs gd git liberation-sans-fonts file libxml2 libxslt catatonit \
&& dnf -y clean all

COPY --from=builder /opt/system/ .
COPY --from=builder /tmp/memkind-*/jemalloc/lib/libjemalloc.so* /usr/local/lib64
COPY --from=builder /usr/local/share/gems /usr/local/share/
COPY --from=builder /usr/local/bin/bundle* /usr/local/bin
# in RHEL 8 podman-catatonit pulls in too many useless deps so we don't install the RPM directly, on RHEL 9 simply use package `catatonit`
COPY --from=builder /usr/libexec/catatonit/catatonit /usr/libexec/catatonit/catatonit

RUN echo /usr/local/lib64 > /etc/ld.so.conf.d/jemalloc.conf \
&& ldconfig && ldconfig -p | grep jemalloc
Expand Down Expand Up @@ -109,7 +103,7 @@ ENV THINKING_SPHINX_ADDRESS=0.0.0.0 \
SECRET_KEY_BASE=dummy \
DATABASE_URL='mysql2://root:@localhost/porta'
USER 0
RUN dnf install -y mysql-server mysql-test \
RUN dnf install --enablerepo=crb -y mysql-server mysql-test \
&& setcap -r /usr/libexec/mysqld \
&& setpriv --reuid 27 --regid 27 --clear-groups mysqld --initialize-insecure \
&& (mysqld_safe &) \
Expand Down

0 comments on commit 70a5ec1

Please sign in to comment.