Skip to content

Commit a320aaa

Browse files
committed
Update Dockerfile to modify correct config file
MySQL 5.7.14 changed the structure of the configuration directory, so /etc/mysql/my.cnf no longer contains the config options, but only includes other directories. This caused the modification done to the config in Dockerfile to fail silently, creating issues with any setups that required those changes, such as running with a different user. Changed script to modify the new file /etc/mysql/mysql.conf.d/mysqld.cnf
1 parent 77f0a50 commit a320aaa

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

5.7/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ RUN { \
5050

5151
# comment out a few problematic configuration values
5252
# don't reverse lookup hostnames, they are usually another container
53-
RUN sed -Ei 's/^(bind-address|log)/#&/' /etc/mysql/my.cnf \
54-
&& echo 'skip-host-cache\nskip-name-resolve' | awk '{ print } $1 == "[mysqld]" && c == 0 { c = 1; system("cat") }' /etc/mysql/my.cnf > /tmp/my.cnf \
55-
&& mv /tmp/my.cnf /etc/mysql/my.cnf
53+
RUN sed -Ei 's/^(bind-address|log)/#&/' /etc/mysql/mysql.conf.d/mysqld.cnf \
54+
&& echo 'skip-host-cache\nskip-name-resolve' | awk '{ print } $1 == "[mysqld]" && c == 0 { c = 1; system("cat") }' /etc/mysql/mysql.conf.d/mysqld.cnf > /tmp/mysqld.cnf \
55+
&& mv /tmp/mysqld.cnf /etc/mysql/mysql.conf.d/mysqld.cnf
5656

5757
VOLUME /var/lib/mysql
5858

0 commit comments

Comments
 (0)