-
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathmysql-8.0
38 lines (36 loc) · 1.29 KB
/
mysql-8.0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# vi: ft=dockerfile
FROM mysql:8.0-oracle
RUN set -eux \
# Set Additional config directories
&& mkdir -p /etc/mysql/docker-default.d/ \
&& if [ -f /etc/my.cnf ]; then \
echo '!'"includedir /etc/mysql/docker-default.d/" >> /etc/my.cnf; \
elif [ -f /etc/mysql/my.cnf ]; then \
echo '!'"includedir /etc/mysql/docker-default.d/" >> /etc/mysql/my.cnf; \
else \
echo "/etc/my.cnf and /etc/mysql/my.cnf are not available"; \
false; \
fi \
\
# Allow native password handling for MySQL 8.0
&& if [ -f /etc/my.cnf ]; then \
sed -i'' 's/^\[mysqld\]/[mysqld]\ndefault-authentication-plugin=mysql_native_password/g' /etc/my.cnf; \
elif [ -f /etc/mysql/my.cnf ]; then \
sed -i'' 's/^\[mysqld\]/[mysqld]\ndefault-authentication-plugin=mysql_native_password/g' /etc/mysql/my.cnf; \
else \
echo "/etc/my.cnf and /etc/mysql/my.cnf are not available"; \
false; \
fi \
\
# Set Docker Entrypoint
&& if [ -f "/entrypoint.sh" ]; then \
mv "/entrypoint.sh" "/docker-entrypoint.sh"; \
elif [ -f "/usr/local/bin/docker-entrypoint.sh" ]; then \
ln -s "/usr/local/bin/docker-entrypoint.sh" "/docker-entrypoint.sh"; \
else \
echo "/entrypoint.sh and /usr/local/bin/docker-entrypoint.sh are not available"; \
false; \
fi \
&& chmod +x "/docker-entrypoint.sh"
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["mysqld"]