Skip to content

Commit 15b3fe6

Browse files
authored
Merge pull request laradock#297 from lialosiu/master
add build options MAX_ALLOWED_PACKET to mysql
2 parents a31cef6 + da6face commit 15b3fe6

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

docker-compose.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,10 @@ services:
101101
### MySQL Container #########################################
102102

103103
mysql:
104-
build: ./mysql
104+
build:
105+
context: ./mysql
106+
args:
107+
- MAX_ALLOWED_PACKET=20M
105108
volumes_from:
106109
- volumes_data
107110
ports:

mysql/Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@ FROM mysql:latest
22

33
MAINTAINER Mahmoud Zalt <mahmoud@zalt.me>
44

5+
ARG MAX_ALLOWED_PACKET=1M
6+
ENV MAX_ALLOWED_PACKET ${MAX_ALLOWED_PACKET}
7+
8+
# Set MAX_ALLOWED_PACKET to /etc/mysql/my.cnf
9+
RUN sed -i "s/^\[mysqld\]$/\[mysqld\]\nmax_allowed_packet = ${MAX_ALLOWED_PACKET}/g" /etc/mysql/my.cnf
10+
511
CMD ["mysqld"]
612

713
EXPOSE 3306

0 commit comments

Comments
 (0)