Ver código fonte

add mysql custom configuration file.

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
Bo-Yi Wu 8 anos atrás
pai
commit
b254d4a9c9
3 arquivos alterados com 8 adições e 9 exclusões
  1. 1 4
      docker-compose.yml
  2. 1 5
      mysql/Dockerfile
  3. 6 0
      mysql/my.cnf

+ 1 - 4
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:

+ 1 - 5
mysql/Dockerfile

@@ -2,11 +2,7 @@ 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
+ADD my.cnf /etc/mysql/conf.d/my.cnf
 
 CMD ["mysqld"]
 

+ 6 - 0
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]