Skip to content

Commit 9584428

Browse files
authored
Merge pull request #232 from infosiftr/docker.cnf
Move docker-specific [mysqld] additions to their own "docker.cnf" file
2 parents b2b4fcf + 10eb5ea commit 9584428

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed

5.6/Dockerfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,7 @@ RUN { \
5151
# comment out a few problematic configuration values
5252
# don't reverse lookup hostnames, they are usually another container
5353
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
54+
&& echo '[mysqld]\nskip-host-cache\nskip-name-resolve' > /etc/mysql/conf.d/docker.cnf
5655

5756
VOLUME /var/lib/mysql
5857

5.7/Dockerfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,7 @@ RUN { \
5151
# comment out a few problematic configuration values
5252
# don't reverse lookup hostnames, they are usually another container
5353
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
54+
&& echo '[mysqld]\nskip-host-cache\nskip-name-resolve' > /etc/mysql/conf.d/docker.cnf
5655

5756
VOLUME /var/lib/mysql
5857

8.0/Dockerfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,7 @@ RUN { \
5151
# comment out a few problematic configuration values
5252
# don't reverse lookup hostnames, they are usually another container
5353
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
54+
&& echo '[mysqld]\nskip-host-cache\nskip-name-resolve' > /etc/mysql/conf.d/docker.cnf
5655

5756
VOLUME /var/lib/mysql
5857

0 commit comments

Comments
 (0)