File tree Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -52,11 +52,12 @@ RUN { \
52
52
&& rm -rf /var/lib/mysql && mkdir -p /var/lib/mysql /var/run/mysqld \
53
53
&& chown -R mysql:mysql /var/lib/mysql /var/run/mysqld \
54
54
# ensure that /var/run/mysqld (used for socket and lock files) is writable regardless of the UID our mysqld instance ends up having at runtime
55
- && chmod 777 /var/run/mysqld
56
-
55
+ && chmod 777 /var/run/mysqld \
57
56
# comment out a few problematic configuration values
57
+ && find /etc/mysql/ -name '*.cnf' -print0 \
58
+ | xargs -0 grep -lZE '^(bind-address|log)' \
59
+ | xargs -rt -0 sed -Ei 's/^(bind-address|log)/#&/' \
58
60
# don't reverse lookup hostnames, they are usually another container
59
- RUN sed -Ei 's/^(bind-address|log)/#&/' /etc/mysql/my.cnf \
60
61
&& echo '[mysqld]\n skip-host-cache\n skip-name-resolve' > /etc/mysql/conf.d/docker.cnf
61
62
62
63
VOLUME /var/lib/mysql
Original file line number Diff line number Diff line change @@ -58,11 +58,12 @@ RUN { \
58
58
&& rm -rf /var/lib/mysql && mkdir -p /var/lib/mysql /var/run/mysqld \
59
59
&& chown -R mysql:mysql /var/lib/mysql /var/run/mysqld \
60
60
# ensure that /var/run/mysqld (used for socket and lock files) is writable regardless of the UID our mysqld instance ends up having at runtime
61
- && chmod 777 /var/run/mysqld
62
-
61
+ && chmod 777 /var/run/mysqld \
63
62
# comment out a few problematic configuration values
63
+ && find /etc/mysql/ -name '*.cnf' -print0 \
64
+ | xargs -0 grep -lZE '^(bind-address|log)' \
65
+ | xargs -rt -0 sed -Ei 's/^(bind-address|log)/#&/' \
64
66
# don't reverse lookup hostnames, they are usually another container
65
- RUN sed -Ei 's/^(bind-address|log)/#&/' /etc/mysql/mysql.conf.d/mysqld.cnf \
66
67
&& echo '[mysqld]\n skip-host-cache\n skip-name-resolve' > /etc/mysql/conf.d/docker.cnf
67
68
68
69
VOLUME /var/lib/mysql
You can’t perform that action at this time.
0 commit comments