Skip to content

Commit

Permalink
Support MariaDB 10.11 (#223)
Browse files Browse the repository at this point in the history
* Add MariaDB 10.11: (move 10.5 -> 10.11) to keep history
* Add MariaDB 10.11 (copy 10.11->10.5)
* Add MariaDB 10.11 (patch s/10.5/10.11)
* Allow pushing MariaDB 10.11 to Quay.io
* Update symlinks to version 10.5
* Disable testing for mariadb-10.11 in Fedora
Do not use modular based mariadb:10.11
Use proper version for 10.11/Dockerfile
Enable module for 10.11/Dockerfile.rhel9 and 10.11/Dockerfile.c9s
Version 10.11 is in scope for CentOS 7 and RHEL7.
Update 10.11/root/usr/share/container-scripts/mysql/README.md
* Disable module for CentOS Stream 9 and version 10.5
* Add missing imagestreams to C8S, C9S, RHEL8, and RHEL9

Signed-off-by: Petr "Stone" Hracek <phracek@redhat.com>
  • Loading branch information
phracek authored Feb 26, 2024
1 parent 7bdbeb3 commit 4d2ab28
Show file tree
Hide file tree
Showing 20 changed files with 869 additions and 6 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/build-and-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,18 @@ jobs:
fail-fast: false
matrix:
include:
- dockerfile: "10.11/Dockerfile.c9s"
registry_namespace: "sclorg"
quayio_username: "QUAY_IMAGE_SCLORG_BUILDER_USERNAME"
quayio_token: "QUAY_IMAGE_SCLORG_BUILDER_TOKEN"
tag: "c9s"
image_name: "mariadb-1011-c9s"
- dockerfile: "10.11/Dockerfile.c8s"
registry_namespace: "sclorg"
quayio_username: "QUAY_IMAGE_SCLORG_BUILDER_USERNAME"
quayio_token: "QUAY_IMAGE_SCLORG_BUILDER_TOKEN"
tag: "c8s"
image_name: "mariadb-1011-c8s"
- dockerfile: "10.5/Dockerfile.c9s"
registry_namespace: "sclorg"
quayio_username: "QUAY_IMAGE_SCLORG_BUILDER_USERNAME"
Expand All @@ -38,6 +50,12 @@ jobs:
quayio_token: "QUAY_IMAGE_FEDORA_BUILDER_TOKEN"
tag: "fedora"
image_name: "mariadb-105"
- dockerfile: "10.11/Dockerfile.fedora"
registry_namespace: "fedora"
quayio_username: "QUAY_IMAGE_FEDORA_BUILDER_USERNAME"
quayio_token: "QUAY_IMAGE_FEDORA_BUILDER_TOKEN"
tag: "fedora"
image_name: "mariadb-1011"

steps:
- name: Build and push to quay.io registry
Expand Down
Empty file added 10.11/.exclude-fedora
Empty file.
71 changes: 71 additions & 0 deletions 10.11/Dockerfile.c8s
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
FROM quay.io/sclorg/s2i-core-c8s:c8s

# 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-c8s" \
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-c8s" \
maintainer="SoftwareCollections.org <sclorg@redhat.com>"

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 /

# 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

# Not using VOLUME statement since it's not working in OpenShift Online:
# https://github.com/sclorg/httpd-container/issues/30
# VOLUME ["/var/lib/mysql/data"]

USER 27

ENTRYPOINT ["container-entrypoint"]
CMD ["run-mysqld"]
71 changes: 71 additions & 0 deletions 10.11/Dockerfile.c9s
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
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 <sclorg@redhat.com>"

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 /

# 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

# Not using VOLUME statement since it's not working in OpenShift Online:
# https://github.com/sclorg/httpd-container/issues/30
# VOLUME ["/var/lib/mysql/data"]

USER 27

ENTRYPOINT ["container-entrypoint"]
CMD ["run-mysqld"]
73 changes: 73 additions & 0 deletions 10.11/Dockerfile.fedora
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
FROM quay.io/fedora/s2i-core:40

# 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 \
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. \
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="MariaDB is a multi-user, multi-threaded SQL database server" \
io.k8s.display-name="MariaDB 10.11" \
io.openshift.expose-services="3306:mysql" \
io.openshift.tags="database,mysql,mariadb,mariadb1011,galera" \
com.redhat.component="$NAME" \
name="fedora/$NAME-1011" \
version="$VERSION" \
usage="docker run -d -e MYSQL_USER=user -e MYSQL_PASSWORD=pass -e MYSQL_DATABASE=db -p 3306:3306 quay.io/fedora/$NAME-1011" \
maintainer="SoftwareCollections.org <sclorg@redhat.com>"

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 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" && \
dnf clean all && \
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 /

# 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

# Not using VOLUME statement since it's not working in OpenShift Online:
# https://github.com/sclorg/httpd-container/issues/30
# VOLUME ["/var/lib/mysql/data"]

USER 27

ENTRYPOINT ["container-entrypoint"]
CMD ["run-mysqld"]
71 changes: 71 additions & 0 deletions 10.11/Dockerfile.rhel8
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
FROM ubi8/s2i-core

# 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="rhel8/mariadb-1011" \
version="1" \
usage="podman run -d -e MYSQL_USER=user -e MYSQL_PASSWORD=pass -e MYSQL_DATABASE=db -p 3306:3306 rhel8/mariadb-1011" \
maintainer="SoftwareCollections.org <sclorg@redhat.com>"

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 /

# 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

# Not using VOLUME statement since it's not working in OpenShift Online:
# https://github.com/sclorg/httpd-container/issues/30
# VOLUME ["/var/lib/mysql/data"]

USER 27

ENTRYPOINT ["container-entrypoint"]
CMD ["run-mysqld"]
71 changes: 71 additions & 0 deletions 10.11/Dockerfile.rhel9
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
FROM ubi9/s2i-core

# 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="rhel9/mariadb-1011" \
version="1" \
usage="podman run -d -e MYSQL_USER=user -e MYSQL_PASSWORD=pass -e MYSQL_DATABASE=db -p 3306:3306 rhel9/mariadb-1011" \
maintainer="SoftwareCollections.org <sclorg@redhat.com>"

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 /

# 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

# Not using VOLUME statement since it's not working in OpenShift Online:
# https://github.com/sclorg/httpd-container/issues/30
# VOLUME ["/var/lib/mysql/data"]

USER 27

ENTRYPOINT ["container-entrypoint"]
CMD ["run-mysqld"]
1 change: 1 addition & 0 deletions 10.11/README.md
1 change: 1 addition & 0 deletions 10.11/root-common
Loading

0 comments on commit 4d2ab28

Please sign in to comment.