Skip to content

Commit aad44c8

Browse files
authored
Merge pull request SensorsIot#666 from Paraphraser/20230214-mariadb-old-menu
2023-02-14 MariaDB Dockerfile - old-menu branch - PR 2 of 3
2 parents 996e570 + 9d65fa1 commit aad44c8

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

.templates/mariadb/Dockerfile

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
# Download base image
22
FROM ghcr.io/linuxserver/mariadb
33

4+
# candidates for customisation are
5+
ENV CANDIDATES="/defaults/my.cnf /defaults/custom.cnf"
6+
47
# apply stability patches recommended in
58
#
69
# https://discord.com/channels/638610460567928832/638610461109256194/825049573520965703
710
# https://stackoverflow.com/questions/61809270/how-to-discover-why-mariadb-crashes
8-
RUN sed -i.bak \
9-
-e "s/^thread_cache_size/# thread_cache_size/" \
10-
-e "s/^read_buffer_size/# read_buffer_size/" \
11-
/defaults/my.cnf
11+
RUN for CNF in ${CANDIDATES} ; do [ -f ${CNF} ] && break ; done ; \
12+
sed -i.bak \
13+
-e "s/^thread_cache_size/# thread_cache_size/" \
14+
-e "s/^read_buffer_size/# read_buffer_size/" \
15+
${CNF}
1216

1317
# copy the health-check script into place
1418
ENV HEALTHCHECK_SCRIPT "iotstack_healthcheck.sh"
@@ -22,4 +26,6 @@ HEALTHCHECK \
2226
--retries=3 \
2327
CMD ${HEALTHCHECK_SCRIPT} || exit 1
2428

29+
ENV CANDIDATES=
30+
2531
# EOF

0 commit comments

Comments
 (0)