@@ -17,14 +17,7 @@ FROM oraclelinux:{{ .oracle.variant }}
17
17
18
18
RUN set -eux; \
19
19
groupadd --system --gid 999 mysql; \
20
- useradd --system --uid 999 --gid 999 --home-dir /var/lib/mysql --no-create-home mysql; \
21
- \
22
- mkdir /var/lib/mysql /var/run/mysqld; \
23
- chown mysql:mysql /var/lib/mysql /var/run/mysqld; \
24
- # 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
25
- chmod 1777 /var/lib/mysql /var/run/mysqld; \
26
- \
27
- mkdir /docker-entrypoint-initdb.d
20
+ useradd --system --uid 999 --gid 999 --home-dir /var/lib/mysql --no-create-home mysql
28
21
29
22
# add gosu for easy step-down from root
30
23
# https://github.com/tianon/gosu/releases
@@ -108,7 +101,21 @@ RUN set -eux; \
108
101
# 5.7 Debian-based images also included "/etc/mysql/mysql.conf.d" so let's include it too
109
102
{ echo '!includedir /etc/mysql/mysql.conf.d/'; } >> /etc/my.cnf; \
110
103
mkdir -p /etc/mysql/mysql.conf.d; \
104
+ \
105
+ # comment out a few problematic configuration values
106
+ find /etc/my.cnf /etc/mysql/ -name '*.cnf' -print0 \
107
+ | xargs -0 grep -lZE '^(bind-address|log)' \
108
+ | xargs -rt -0 sed -Ei 's/^(bind-address|log)/#&/'; \
109
+ \
111
110
{{ ) else "" end -}}
111
+ # ensure these directories exist and have useful permissions
112
+ # the rpm package has different opinions on the mode of `/var/run/mysqld`, so this needs to be after install
113
+ mkdir -p /var/lib/mysql /var/run/mysqld; \
114
+ chown mysql:mysql /var/lib/mysql /var/run/mysqld; \
115
+ # 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
116
+ chmod 1777 /var/lib/mysql /var/run/mysqld; \
117
+ \
118
+ mkdir /docker-entrypoint-initdb.d; \
112
119
\
113
120
mysqld --version; \
114
121
mysql --version
0 commit comments