Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
mariadb-container/10.2/Dockerfile.rhel7
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
80 lines (68 sloc)
3.27 KB
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
| FROM rhscl/s2i-core-rhel7 | |
| # 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.2 \ | |
| APP_DATA=/opt/app-root/src \ | |
| HOME=/var/lib/mysql \ | |
| SUMMARY="MariaDB 10.2 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.2" \ | |
| io.openshift.expose-services="3306:mysql" \ | |
| io.openshift.tags="database,mysql,mariadb,mariadb102,rh-mariadb102" \ | |
| com.redhat.component="rh-mariadb102-container" \ | |
| name="rhscl/mariadb-102-rhel7" \ | |
| version="1" \ | |
| com.redhat.license_terms="https://www.redhat.com/en/about/red-hat-end-user-license-agreements#rhel" \ | |
| usage="docker run -d -e MYSQL_USER=user -e MYSQL_PASSWORD=pass -e MYSQL_DATABASE=db -p 3306:3306 rhscl/mariadb-102-rhel7" \ | |
| 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 install -y yum-utils && \ | |
| prepare-yum-repositories rhel-server-rhscl-7-rpms && \ | |
| INSTALL_PKGS="rsync tar gettext hostname bind-utils groff-base rh-mariadb102 rh-mariadb102-mariadb-syspaths" && \ | |
| yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \ | |
| rpm -V $INSTALL_PKGS && \ | |
| 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=/opt/rh/rh-mariadb102/root/usr \ | |
| ENABLED_COLLECTIONS=rh-mariadb102 | |
| # When bash is started non-interactively, to run a shell script, for example it | |
| # looks for this variable and source the content of this file. This will enable | |
| # the SCL for all scripts without need to do 'scl enable'. | |
| ENV BASH_ENV=${CONTAINER_SCRIPTS_PATH}/scl_enable \ | |
| ENV=${CONTAINER_SCRIPTS_PATH}/scl_enable \ | |
| PROMPT_COMMAND=". ${CONTAINER_SCRIPTS_PATH}/scl_enable" | |
| COPY 10.2/root-common / | |
| COPY 10.2/s2i-common/bin/ $STI_SCRIPTS_PATH | |
| COPY 10.2/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"] |