2016-11-16 17:06:30 +08:00
|
|
|
FROM mysql:5.7
|
2016-05-06 22:04:02 +08:00
|
|
|
|
|
|
|
MAINTAINER Mahmoud Zalt <mahmoud@zalt.me>
|
|
|
|
|
2017-06-13 06:55:05 +08:00
|
|
|
#####################################
|
|
|
|
# Set Timezone
|
|
|
|
#####################################
|
|
|
|
|
|
|
|
ARG TZ=UTC
|
|
|
|
ENV TZ ${TZ}
|
|
|
|
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
|
|
|
|
2016-11-18 05:37:51 +08:00
|
|
|
RUN chown -R mysql:root /var/lib/mysql/
|
|
|
|
|
2017-07-01 08:48:24 +08:00
|
|
|
ADD startup /etc/mysql/startup
|
|
|
|
|
|
|
|
ARG MYSQL_DATABASE=default
|
|
|
|
ARG MYSQL_USER=default
|
|
|
|
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 08:39:25 +08:00
|
|
|
ADD my.cnf /etc/mysql/conf.d/my.cnf
|
2016-09-09 10:21:33 +08:00
|
|
|
|
2017-07-01 08:48:24 +08:00
|
|
|
CMD ["mysqld", "--init-file=/etc/mysql/startup"]
|
2016-05-06 22:04:02 +08:00
|
|
|
|
2016-10-15 03:04:24 +08:00
|
|
|
EXPOSE 3306
|