Skip to content

Commit

Permalink
Switch MariaDB in targets to TIER one
Browse files Browse the repository at this point in the history
(This one is not currently used anyway.)
  • Loading branch information
mederly committed Oct 22, 2018
1 parent 612afe2 commit 5e35551
Showing 1 changed file with 6 additions and 30 deletions.
36 changes: 6 additions & 30 deletions demo/complex/targets/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,31 +1,7 @@
FROM centos:centos7
FROM tier/mariadb:mariadb10

LABEL author="tier-packaging@internet2.edu <tier-packaging@internet2.edu>"

COPY container_files/seed-data/ /seed-data/

RUN yum install -y epel-release \
&& yum update -y \
&& yum install -y mariadb-server mariadb \
&& yum clean all \
&& rm -rf /var/cache/yum

RUN mysql_install_db \
&& chown -R mysql:mysql /var/lib/mysql/ \
&& sed -i 's/^\(bind-address\s.*\)/# \1/' /etc/my.cnf \
&& sed -i 's/^\(log_error\s.*\)/# \1/' /etc/my.cnf \
&& sed -i 's/\[mysqld\]/\[mysqld\]\ncharacter_set_server = utf8/' /etc/my.cnf \
&& sed -i 's/\[mysqld\]/\[mysqld\]\ncollation_server = utf8_general_ci/' /etc/my.cnf \
&& sed -i 's/\[mysqld\]/\[mysqld\]\nport = 3306/' /etc/my.cnf \
&& cat /etc/my.cnf \
&& echo "/usr/bin/mysqld_safe &" > /tmp/config \
&& echo "mysqladmin --silent --wait=30 ping || exit 1" >> /tmp/config \
&& echo "mysql -e 'GRANT ALL PRIVILEGES ON *.* TO \"root\"@\"%\" WITH GRANT OPTION;'" >> /tmp/config \
&& echo "mysql -e 'CREATE DATABASE target CHARACTER SET utf8 COLLATE utf8_bin;'" >> /tmp/config \
&& bash /tmp/config \
&& rm -f /tmp/config \
&& mysql target < /seed-data/target.sql

EXPOSE 3306

CMD mysqld_safe
#TODO better name for the target database
ENV MYSQL_DATABASE target
ENV MYSQL_USER target_user
ENV MYSQL_PASSWORD fdjskjrkwqjrw
ENV MYSQL_DATADIR /var/lib/mysql

0 comments on commit 5e35551

Please sign in to comment.