From 48ba15ed6f64fa3f4fafdceb7f6e40f65af92a5b Mon Sep 17 00:00:00 2001 From: Daniel Black Date: Mon, 20 May 2024 17:25:53 +1000 Subject: [PATCH] ubiminimal --- 10.11-ubi/Dockerfile | 16 ++++++++-------- 10.11-ubi/MariaDB.repo | 3 ++- 10.6-ubi/Dockerfile | 16 ++++++++-------- 10.6-ubi/MariaDB.repo | 3 ++- Dockerfile-ubi.template | 16 ++++++++-------- MariaDB-ubi.repo | 3 ++- 6 files changed, 30 insertions(+), 27 deletions(-) diff --git a/10.11-ubi/Dockerfile b/10.11-ubi/Dockerfile index 4d7d7494..f8a95d1c 100644 --- a/10.11-ubi/Dockerfile +++ b/10.11-ubi/Dockerfile @@ -1,9 +1,7 @@ -FROM redhat/ubi9 +FROM redhat/ubi9-minimal -# systemd-coredump has the uid 999, input has group 999, that we want to use for compatibility with the ubuntu image. -RUN groupdel input && \ - userdel systemd-coredump && \ - groupadd --gid 999 -r mysql && \ +# user 999/ group 999, that we want to use for compatibility with the ubuntu image. +RUN groupadd --gid 999 -r mysql && \ useradd -r -g mysql mysql --home-dir /var/lib/mysql --uid 999 ARG TARGETARCH @@ -27,13 +25,15 @@ COPY MariaDB.repo /etc/yum.repos.d/ # libboost_program_options.so.1.66.0 only used by garb - should fix upstream RUN gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys FF8AD1344597106ECE813B918A3872BF3228467C && \ rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm && \ - dnf update -y && \ - dnf install -y procps-ng zstd xz jemalloc pwgen tzdata && \ + rpmkeys --import https://supplychain.mariadb.com/MariaDB-Server-GPG-KEY && \ + microdnf update -y && \ + microdnf install -y procps-ng zstd xz jemalloc pwgen tzdata && \ for pkg in boost-program-options-1.75.0-8; do \ rpm -ivh https://repo.almalinux.org/almalinux/9/AppStream/$(arch)/os/Packages/${pkg}.el9.$(arch).rpm ; \ done ; \ - dnf install -y MariaDB-backup-10.11.8 MariaDB-server-10.11.8 && \ + microdnf install -y MariaDB-backup-10.11.8 MariaDB-server-10.11.8 && \ ln -s /usr/lib64/galera-4/libgalera_smm.so /usr/lib/libgalera_smm.so && \ + microdnf clean all rm -rf /var/lib/mysql; \ mkdir -p /var/lib/mysql /var/run/mysqld /etc/mysql/conf.d/ /etc/mysql/mariadb.conf.d/; \ chown -R mysql:mysql /var/lib/mysql /var/run/mysqld; \ diff --git a/10.11-ubi/MariaDB.repo b/10.11-ubi/MariaDB.repo index 769b6e99..f840eacc 100644 --- a/10.11-ubi/MariaDB.repo +++ b/10.11-ubi/MariaDB.repo @@ -2,5 +2,6 @@ name = MariaDB #baseurl = https://rpm.mariadb.org/10.11/rhel/$releasever/$basearch baseurl = https://archive.mariadb.org/mariadb-10.11/yum/rhel/$releasever/$basearch -gpgkey=https://archive.mariadb.org/PublicKey +#microdnf cannot read to the second key here. +#gpgkey=https://archive.mariadb.org/PublicKey gpgcheck=1 diff --git a/10.6-ubi/Dockerfile b/10.6-ubi/Dockerfile index d3e57747..48cf448d 100644 --- a/10.6-ubi/Dockerfile +++ b/10.6-ubi/Dockerfile @@ -1,9 +1,7 @@ -FROM redhat/ubi9 +FROM redhat/ubi9-minimal -# systemd-coredump has the uid 999, input has group 999, that we want to use for compatibility with the ubuntu image. -RUN groupdel input && \ - userdel systemd-coredump && \ - groupadd --gid 999 -r mysql && \ +# user 999/ group 999, that we want to use for compatibility with the ubuntu image. +RUN groupadd --gid 999 -r mysql && \ useradd -r -g mysql mysql --home-dir /var/lib/mysql --uid 999 ARG TARGETARCH @@ -27,13 +25,15 @@ COPY MariaDB.repo /etc/yum.repos.d/ # libboost_program_options.so.1.66.0 only used by garb - should fix upstream RUN gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys FF8AD1344597106ECE813B918A3872BF3228467C && \ rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm && \ - dnf update -y && \ - dnf install -y procps-ng zstd xz jemalloc pwgen tzdata && \ + rpmkeys --import https://supplychain.mariadb.com/MariaDB-Server-GPG-KEY && \ + microdnf update -y && \ + microdnf install -y procps-ng zstd xz jemalloc pwgen tzdata && \ for pkg in boost-program-options-1.75.0-8; do \ rpm -ivh https://repo.almalinux.org/almalinux/9/AppStream/$(arch)/os/Packages/${pkg}.el9.$(arch).rpm ; \ done ; \ - dnf install -y MariaDB-backup-10.6.18 MariaDB-server-10.6.18 && \ + microdnf install -y MariaDB-backup-10.6.18 MariaDB-server-10.6.18 && \ ln -s /usr/lib64/galera-4/libgalera_smm.so /usr/lib/libgalera_smm.so && \ + microdnf clean all rm -rf /var/lib/mysql; \ mkdir -p /var/lib/mysql /var/run/mysqld /etc/mysql/conf.d/ /etc/mysql/mariadb.conf.d/; \ chown -R mysql:mysql /var/lib/mysql /var/run/mysqld; \ diff --git a/10.6-ubi/MariaDB.repo b/10.6-ubi/MariaDB.repo index 4a7e039f..445969c5 100644 --- a/10.6-ubi/MariaDB.repo +++ b/10.6-ubi/MariaDB.repo @@ -2,5 +2,6 @@ name = MariaDB #baseurl = https://rpm.mariadb.org/10.6/rhel/$releasever/$basearch baseurl = https://archive.mariadb.org/mariadb-10.6/yum/rhel/$releasever/$basearch -gpgkey=https://archive.mariadb.org/PublicKey +#microdnf cannot read to the second key here. +#gpgkey=https://archive.mariadb.org/PublicKey gpgcheck=1 diff --git a/Dockerfile-ubi.template b/Dockerfile-ubi.template index 4ba9115a..56e3985e 100644 --- a/Dockerfile-ubi.template +++ b/Dockerfile-ubi.template @@ -1,9 +1,7 @@ -FROM redhat/ubi9 +FROM redhat/ubi9-minimal -# systemd-coredump has the uid 999, input has group 999, that we want to use for compatibility with the ubuntu image. -RUN groupdel input && \ - userdel systemd-coredump && \ - groupadd --gid 999 -r mysql && \ +# user 999/ group 999, that we want to use for compatibility with the ubuntu image. +RUN groupadd --gid 999 -r mysql && \ useradd -r -g mysql mysql --home-dir /var/lib/mysql --uid 999 ARG TARGETARCH @@ -27,13 +25,15 @@ COPY MariaDB.repo /etc/yum.repos.d/ # libboost_program_options.so.1.66.0 only used by garb - should fix upstream RUN gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys FF8AD1344597106ECE813B918A3872BF3228467C && \ rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm && \ - dnf update -y && \ - dnf install -y procps-ng zstd xz jemalloc pwgen tzdata && \ + rpmkeys --import https://supplychain.mariadb.com/MariaDB-Server-GPG-KEY && \ + microdnf update -y && \ + microdnf install -y procps-ng zstd xz jemalloc pwgen tzdata && \ for pkg in boost-program-options-1.75.0-8; do \ rpm -ivh https://repo.almalinux.org/almalinux/9/AppStream/$(arch)/os/Packages/${pkg}.el9.$(arch).rpm ; \ done ; \ - dnf install -y MariaDB-backup-%%MARIADB_VERSION_BASIC%% MariaDB-server-%%MARIADB_VERSION_BASIC%% && \ + microdnf install -y MariaDB-backup-%%MARIADB_VERSION_BASIC%% MariaDB-server-%%MARIADB_VERSION_BASIC%% && \ ln -s /usr/lib64/galera-4/libgalera_smm.so /usr/lib/libgalera_smm.so && \ + microdnf clean all rm -rf /var/lib/mysql; \ mkdir -p /var/lib/mysql /var/run/mysqld /etc/mysql/conf.d/ /etc/mysql/mariadb.conf.d/; \ chown -R mysql:mysql /var/lib/mysql /var/run/mysqld; \ diff --git a/MariaDB-ubi.repo b/MariaDB-ubi.repo index 30b22d18..3c278eeb 100644 --- a/MariaDB-ubi.repo +++ b/MariaDB-ubi.repo @@ -2,5 +2,6 @@ name = MariaDB #baseurl = https://rpm.mariadb.org/%%MARIADB_VERSION%%/rhel/$releasever/$basearch baseurl = https://archive.mariadb.org/mariadb-%%MARIADB_VERSION%%/yum/rhel/$releasever/$basearch -gpgkey=https://archive.mariadb.org/PublicKey +#microdnf cannot read to the second key here. +#gpgkey=https://archive.mariadb.org/PublicKey gpgcheck=1