-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Copy Dockerfile.c10s based on Dockerfile.c9s
Signed-off-by: Petr "Stone" Hracek <[email protected]>
- Loading branch information
Showing
1 changed file
with
72 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 <[email protected]>" | ||
|
||
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"] |