2016-11-16 10:06:30 +01:00
|
|
|
FROM mysql:5.7
|
2016-05-06 16:04:02 +02:00
|
|
|
|
|
|
|
MAINTAINER Mahmoud Zalt <mahmoud@zalt.me>
|
|
|
|
|
2016-11-17 22:37:51 +01:00
|
|
|
ADD startup /etc/mysql/startup
|
|
|
|
|
|
|
|
RUN chown -R mysql:root /var/lib/mysql/
|
|
|
|
|
2017-03-17 08:36:00 +01:00
|
|
|
ARG MYSQL_DATABASE=default
|
|
|
|
ARG MYSQL_USER=default
|
2016-11-17 22:37:51 +01:00
|
|
|
ARG MYSQL_PASSWORD=secret
|
|
|
|
ARG MYSQL_ROOT_PASSWORD=root
|
|
|
|
|
|
|
|
ENV MYSQL_DATABASE=$MYSQL_DATABASE
|
|
|
|
ENV MYSQL_USER=$MYSQL_USER
|
|
|
|
ENV MYSQL_PASSWORD=$MYSQL_PASSWORD
|
|
|
|
ENV MYSQL_ROOT_PASSWORD=$MYSQL_ROOT_PASSWORD
|
|
|
|
|
|
|
|
RUN sed -i 's/MYSQL_DATABASE/'$MYSQL_DATABASE'/g' /etc/mysql/startup && \
|
|
|
|
sed -i 's/MYSQL_USER/'$MYSQL_USER'/g' /etc/mysql/startup && \
|
|
|
|
sed -i 's/MYSQL_PASSWORD/'$MYSQL_PASSWORD'/g' /etc/mysql/startup
|
|
|
|
|
2016-09-11 02:39:25 +02:00
|
|
|
ADD my.cnf /etc/mysql/conf.d/my.cnf
|
2016-09-09 04:21:33 +02:00
|
|
|
|
2016-11-17 22:37:51 +01:00
|
|
|
CMD ["mysqld", "--init-file=/etc/mysql/startup"]
|
2016-05-06 16:04:02 +02:00
|
|
|
|
2016-10-14 21:04:24 +02:00
|
|
|
EXPOSE 3306
|