Update Dockerfile

This commit is contained in:
James Whiteman 2017-04-07 14:24:15 +12:00 committed by GitHub
parent 07021b01f4
commit 8820501644
1 changed files with 1 additions and 17 deletions

View File

@ -2,26 +2,10 @@ FROM mysql:5.7
MAINTAINER Mahmoud Zalt <mahmoud@zalt.me> MAINTAINER Mahmoud Zalt <mahmoud@zalt.me>
ADD startup /etc/mysql/startup
RUN chown -R mysql:root /var/lib/mysql/ RUN chown -R mysql:root /var/lib/mysql/
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
ADD my.cnf /etc/mysql/conf.d/my.cnf ADD my.cnf /etc/mysql/conf.d/my.cnf
CMD ["mysqld", "--init-file=/etc/mysql/startup"] CMD ["mysqld"]
EXPOSE 3306 EXPOSE 3306