From b254d4a9c9cc613e91ce60157074355b62d73cb5 Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Sun, 11 Sep 2016 08:39:25 +0800 Subject: [PATCH] add mysql custom configuration file. Signed-off-by: Bo-Yi Wu --- docker-compose.yml | 5 +---- mysql/Dockerfile | 6 +----- mysql/my.cnf | 6 ++++++ 3 files changed, 8 insertions(+), 9 deletions(-) create mode 100644 mysql/my.cnf diff --git a/docker-compose.yml b/docker-compose.yml index 0303a81..9e68b63 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -101,10 +101,7 @@ services: ### MySQL Container ######################################### mysql: - build: - context: ./mysql - args: - - MAX_ALLOWED_PACKET=20M + build: ./mysql volumes_from: - volumes_data ports: diff --git a/mysql/Dockerfile b/mysql/Dockerfile index c5451ef..51d7fb2 100644 --- a/mysql/Dockerfile +++ b/mysql/Dockerfile @@ -2,11 +2,7 @@ FROM mysql:latest MAINTAINER Mahmoud Zalt -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 +ADD my.cnf /etc/mysql/conf.d/my.cnf CMD ["mysqld"] diff --git a/mysql/my.cnf b/mysql/my.cnf new file mode 100644 index 0000000..e4c1ddb --- /dev/null +++ b/mysql/my.cnf @@ -0,0 +1,6 @@ +# The MySQL Client configuration file. +# +# For explanations see +# http://dev.mysql.com/doc/mysql/en/server-system-variables.html + +[mysql]