add build options MAX_ALLOWED_PACKET to mysql

This commit is contained in:
Lialosiu 2016-09-09 10:21:33 +08:00
parent a31cef6eb1
commit da6face95e
2 changed files with 10 additions and 1 deletions

View File

@ -101,7 +101,10 @@ services:
### MySQL Container #########################################
mysql:
build: ./mysql
build:
context: ./mysql
args:
- MAX_ALLOWED_PACKET=20M
volumes_from:
- volumes_data
ports:

View File

@ -2,6 +2,12 @@ FROM mysql:latest
MAINTAINER Mahmoud Zalt <mahmoud@zalt.me>
ARG MAX_ALLOWED_PACKET=1M
ENV MAX_ALLOWED_PACKET ${MAX_ALLOWED_PACKET}
# Set MAX_ALLOWED_PACKET to /etc/mysql/my.cnf
RUN sed -i "s/^\[mysqld\]$/\[mysqld\]\nmax_allowed_packet = ${MAX_ALLOWED_PACKET}/g" /etc/mysql/my.cnf
CMD ["mysqld"]
EXPOSE 3306