FROM centos:7 MAINTAINER Systems EXPOSE 3306 ENV MARIADB_VERSION 10.3.8 ENV BUILD_PACKAGES \ autoconf \ automake \ bison \ gcc \ gcc-c++ \ git \ libevent-devel \ libxml2-devel \ make \ rpm-build \ valgrind \ valgrind-devel # Add our user and group first to make sure their IDs get assigned consistently, # regardless of whatever dependencies get added. # Not using 999 because on CentOS 999 GID is already taken. RUN groupadd -g 990 mysql && \ useradd -r -u 990 -g mysql mysql # Break into multiple runs to take advantage of caching RUN set -x \ # sysvinit-tools needed for pidof in entrypoint && yum-builddep -y mariadb-server \ && yum -y install $BUILD_PACKAGES sysvinit-tools\ && yum clean all \ && rm -rf /var/cache/yum RUN set -x \ && git clone https://github.com/MariaDB/server.git mariadb \ && cd mariadb \ && git checkout mariadb-$MARIADB_VERSION \ && git submodule init \ && git submodule update \ && bash BUILD/compile-amd64-valgrind-max \ && make install \ && cd .. \ && rm -rf mariadb \ && mkdir -p /var/lib/mysql /var/log/mysql /var/run/mysqld \ && chown -R mysql:mysql /var/lib/mysql /var/log/mysql /var/run/mysqld \ && rm -rf /var/cache/yum mysql-repo.rpm /etc/my.cnf /etc/my.cnf.d/ \ && ln -s /etc/mysql/my.cnf /etc/my.cnf ADD entrypoint /entrypoint ADD mysql_install_db /usr/local/mysql/bin/ VOLUME ["/var/lib/mysql"] VOLUME ["/var/log/mysql"] VOLUME ["/var/run/mysqld"] USER 990 ENTRYPOINT ["/entrypoint"] CMD ["valgrind", "--tool=massif", "--massif-out-file=/var/log/mysql/massif.out", "/usr/local/mysql/bin/mysqld"]