From 0b655830e943b5fab23df78cf7fcfc36a8a144c3 Mon Sep 17 00:00:00 2001 From: "Petr \"Stone\" Hracek" Date: Wed, 24 Jul 2024 09:07:22 +0200 Subject: [PATCH 1/3] Copy Dockerfile.c10s based on Dockerfile.c9s Signed-off-by: Petr "Stone" Hracek --- 10.11/Dockerfile.c10s | 72 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 10.11/Dockerfile.c10s diff --git a/10.11/Dockerfile.c10s b/10.11/Dockerfile.c10s new file mode 100644 index 0000000..a34ba3c --- /dev/null +++ b/10.11/Dockerfile.c10s @@ -0,0 +1,72 @@ +FROM quay.io/sclorg/s2i-core-c9s:c9s + +# MariaDB image for OpenShift. +# +# Volumes: +# * /var/lib/mysql/data - Datastore for MariaDB +# Environment: +# * $MYSQL_USER - Database user name +# * $MYSQL_PASSWORD - User's password +# * $MYSQL_DATABASE - Name of the database to create +# * $MYSQL_ROOT_PASSWORD (Optional) - Password for the 'root' MySQL account + +ENV MYSQL_VERSION=10.11 \ + APP_DATA=/opt/app-root/src \ + HOME=/var/lib/mysql \ + SUMMARY="MariaDB 10.11 SQL database server" \ + DESCRIPTION="MariaDB is a multi-user, multi-threaded SQL database server. The container \ +image provides a containerized packaging of the MariaDB mysqld daemon and client application. \ +The mysqld server daemon accepts connections from clients and provides access to content from \ +MariaDB databases on behalf of the clients." + +LABEL summary="$SUMMARY" \ + description="$DESCRIPTION" \ + io.k8s.description="$DESCRIPTION" \ + io.k8s.display-name="MariaDB 10.11" \ + io.openshift.expose-services="3306:mysql" \ + io.openshift.tags="database,mysql,mariadb,mariadb1011,mariadb-1011" \ + com.redhat.component="mariadb-1011-container" \ + name="sclorg/mariadb-1011-c9s" \ + version="1" \ + usage="podman run -d -e MYSQL_USER=user -e MYSQL_PASSWORD=pass -e MYSQL_DATABASE=db -p 3306:3306 quay.io/sclorg/mariadb-1011-c9s" \ + maintainer="SoftwareCollections.org " + +EXPOSE 3306 + +# This image must forever use UID 27 for mysql user so our volumes are +# safe in the future. This should *never* change, the last test is there +# to make sure of that. +RUN yum -y module enable mariadb:$MYSQL_VERSION && \ + INSTALL_PKGS="policycoreutils rsync tar gettext hostname bind-utils groff-base mariadb-server" && \ + yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \ + rpm -V $INSTALL_PKGS && \ + /usr/libexec/mysqld -V | grep -qe "$MYSQL_VERSION\." && echo "Found VERSION $MYSQL_VERSION" && \ + yum -y clean all --enablerepo='*' && \ + mkdir -p /var/lib/mysql/data && chown -R mysql.0 /var/lib/mysql && \ + test "$(id mysql)" = "uid=27(mysql) gid=27(mysql) groups=27(mysql)" + +# Get prefix path and path to scripts rather than hard-code them in scripts +ENV CONTAINER_SCRIPTS_PATH=/usr/share/container-scripts/mysql \ + MYSQL_PREFIX=/usr + +COPY 10.11/root-common / +COPY 10.11/s2i-common/bin/ $STI_SCRIPTS_PATH +COPY 10.11/root / + +# Hard links are not supported in Testing Farm approach during sync to guest +# operation system. Therefore tests are failing on error +# /usr/libexec/s2i/run no such file or directory +RUN ln -s /usr/bin/run-mysqld $STI_SCRIPTS_PATH/run + +# this is needed due to issues with squash +# when this directory gets rm'd by the container-setup +# script. +# Also reset permissions of filesystem to default values +RUN rm -rf /etc/my.cnf.d/* && \ + /usr/libexec/container-setup && \ + rpm-file-permissions + +USER 27 + +ENTRYPOINT ["container-entrypoint"] +CMD ["run-mysqld"] From f0c0070b4eb330a0312e5c36b9bfbcf914a21803 Mon Sep 17 00:00:00 2001 From: "Petr \"Stone\" Hracek" Date: Fri, 26 Jul 2024 12:10:54 +0200 Subject: [PATCH 2/3] Add Dockerfile.c10s to version 10.11 Update README's so it contains also CentOS Stream 10 Signed-off-by: Petr "Stone" Hracek --- 10.11/Dockerfile.c10s | 20 ++++++++++--------- .../share/container-scripts/mysql/README.md | 1 + README.md | 2 ++ 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/10.11/Dockerfile.c10s b/10.11/Dockerfile.c10s index a34ba3c..e64594a 100644 --- a/10.11/Dockerfile.c10s +++ b/10.11/Dockerfile.c10s @@ -1,4 +1,4 @@ -FROM quay.io/sclorg/s2i-core-c9s:c9s +FROM quay.io/sclorg/s2i-core-c10s:c10s # MariaDB image for OpenShift. # @@ -13,6 +13,9 @@ FROM quay.io/sclorg/s2i-core-c9s:c9s ENV MYSQL_VERSION=10.11 \ APP_DATA=/opt/app-root/src \ HOME=/var/lib/mysql \ + NAME=mariadb \ + VERSION=10.11 \ + ARCH=x86_64 \ SUMMARY="MariaDB 10.11 SQL database server" \ DESCRIPTION="MariaDB is a multi-user, multi-threaded SQL database server. The container \ image provides a containerized packaging of the MariaDB mysqld daemon and client application. \ @@ -22,13 +25,13 @@ MariaDB databases on behalf of the clients." LABEL summary="$SUMMARY" \ description="$DESCRIPTION" \ io.k8s.description="$DESCRIPTION" \ - io.k8s.display-name="MariaDB 10.11" \ + io.k8s.display-name="MariaDB $VERSION" \ io.openshift.expose-services="3306:mysql" \ io.openshift.tags="database,mysql,mariadb,mariadb1011,mariadb-1011" \ - com.redhat.component="mariadb-1011-container" \ - name="sclorg/mariadb-1011-c9s" \ + com.redhat.component="$NAME-1011-container" \ + name="sclorg/$NAME-1011-c10s" \ version="1" \ - usage="podman run -d -e MYSQL_USER=user -e MYSQL_PASSWORD=pass -e MYSQL_DATABASE=db -p 3306:3306 quay.io/sclorg/mariadb-1011-c9s" \ + usage="podman run -d -e MYSQL_USER=user -e MYSQL_PASSWORD=pass -e MYSQL_DATABASE=db -p 3306:3306 quay.io/sclorg/$NAME-1011-c10s" \ maintainer="SoftwareCollections.org " EXPOSE 3306 @@ -36,12 +39,11 @@ EXPOSE 3306 # This image must forever use UID 27 for mysql user so our volumes are # safe in the future. This should *never* change, the last test is there # to make sure of that. -RUN yum -y module enable mariadb:$MYSQL_VERSION && \ - INSTALL_PKGS="policycoreutils rsync tar gettext hostname bind-utils groff-base mariadb-server" && \ - yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \ +RUN INSTALL_PKGS="policycoreutils rsync tar gettext hostname bind-utils groff-base mariadb-server" && \ + dnf install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \ rpm -V $INSTALL_PKGS && \ /usr/libexec/mysqld -V | grep -qe "$MYSQL_VERSION\." && echo "Found VERSION $MYSQL_VERSION" && \ - yum -y clean all --enablerepo='*' && \ + dnf -y clean all --enablerepo='*' && \ mkdir -p /var/lib/mysql/data && chown -R mysql.0 /var/lib/mysql && \ test "$(id mysql)" = "uid=27(mysql) gid=27(mysql) groups=27(mysql)" diff --git a/10.11/root/usr/share/container-scripts/mysql/README.md b/10.11/root/usr/share/container-scripts/mysql/README.md index d428a59..ca0c0da 100644 --- a/10.11/root/usr/share/container-scripts/mysql/README.md +++ b/10.11/root/usr/share/container-scripts/mysql/README.md @@ -363,4 +363,5 @@ https://github.com/sclorg/mariadb-container. In that repository, the Dockerfile for RHEL8 is called Dockerfile.rhel8, the Dockerfile for RHEL9 is called Dockerfile.rhel9, the Dockerfile for CentOS Stream 9 is called Dockerfile.c9s, +the Dockerfile for CentOS Stream 10 is called Dockerfile.c10s, and the Dockerfile for Fedora is called Dockerfile.fedora. diff --git a/README.md b/README.md index 3ace085..8ed7125 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,7 @@ MariaDB SQL Database Server Docker Image Images available on Quay are: * CentOS Stream 9 [mariadb-105](https://quay.io/repository/sclorg/mariadb-105-c9s) * CentOS Stream 9 [mariadb-1011](https://quay.io/repository/sclorg/mariadb-1011-c9s) +* CentOS Stream 10 [mariadb-1011](https://quay.io/repository/sclorg/mariadb-1011-c10s) * Fedora [mariadb-103](https://quay.io/repository/fedora/mariadb-103) * Fedora [mariadb-105](https://quay.io/repository/fedora/mariadb-105) * Fedora [mariadb-1011](https://quay.io/repository/fedora/mariadb-1011) @@ -38,6 +39,7 @@ RHEL versions currently supported are: CentOS versions currently supported are: * CentOS Stream 9 +* CentOS Stream 10 Installation From db40b85cae648d58ab59eb5f4bc163f9cb96abf5 Mon Sep 17 00:00:00 2001 From: "Petr \"Stone\" Hracek" Date: Fri, 26 Jul 2024 12:11:28 +0200 Subject: [PATCH 3/3] Update build-and-push action so we have C10S available on quay.io/sclorg/mariadb-1011-c10s Signed-off-by: Petr "Stone" Hracek --- .github/workflows/build-and-push.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/build-and-push.yml b/.github/workflows/build-and-push.yml index a093714..9ed1478 100644 --- a/.github/workflows/build-and-push.yml +++ b/.github/workflows/build-and-push.yml @@ -22,6 +22,14 @@ jobs: tag: "c9s" image_name: "mariadb-1011-c9s" + - dockerfile: "10.11/Dockerfile.c10s" + docker_context: "10.11" + registry_namespace: "sclorg" + quayio_username: "QUAY_IMAGE_SCLORG_BUILDER_USERNAME" + quayio_token: "QUAY_IMAGE_SCLORG_BUILDER_TOKEN" + tag: "c10s" + image_name: "mariadb-1011-c10s" + - dockerfile: "10.5/Dockerfile.c9s" docker_context: "10.5" registry_namespace: "sclorg"