fix mysql custom parameters
This commit is contained in:
parent
fc7b026b0a
commit
989f283b6f
@ -5,7 +5,8 @@ RUN apt-get update && \
|
|||||||
DEBIAN_FRONTEND=noninteractive apt-get install -q -y cron sudo automysqlbackup
|
DEBIAN_FRONTEND=noninteractive apt-get install -q -y cron sudo automysqlbackup
|
||||||
|
|
||||||
COPY mysql.cnf /etc/mysql/mariadb.conf.d/settings.cnf
|
COPY mysql.cnf /etc/mysql/mariadb.conf.d/settings.cnf
|
||||||
RUN chown mysql:mysql /etc/mysql/mariadb.conf.d/settings.cnf
|
COPY custom.cnf /etc/mysql/mariadb.conf.d/custom.cnf
|
||||||
|
RUN chown mysql:mysql /etc/mysql/mariadb.conf.d/custom.cnf
|
||||||
COPY docker-entrypoint.sh /usr/local/bin/
|
COPY docker-entrypoint.sh /usr/local/bin/
|
||||||
COPY healthcheck.sh /usr/local/bin/
|
COPY healthcheck.sh /usr/local/bin/
|
||||||
COPY automysqlbackup /etc/default
|
COPY automysqlbackup /etc/default
|
||||||
|
4
custom.cnf
Normal file
4
custom.cnf
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
[mysqld]
|
||||||
|
server_id=33
|
||||||
|
replicate-do-db=
|
||||||
|
read-only
|
@ -330,13 +330,14 @@ if ! _is_sourced; then
|
|||||||
SERVER_ID=${SERVER_ID:-33}
|
SERVER_ID=${SERVER_ID:-33}
|
||||||
READONLY=${READONLY:-1}
|
READONLY=${READONLY:-1}
|
||||||
|
|
||||||
cat >>/etc/mysql/mariadb.conf.d/settings.cnf <<EOF
|
cat >/etc/mysql/mariadb.conf.d/custom.cnf <<EOF
|
||||||
|
[mysqld]
|
||||||
server_id=${SERVER_ID}
|
server_id=${SERVER_ID}
|
||||||
replicate-do-db=${REPLICATE_DO_DB}
|
replicate-do-db=${REPLICATE_DO_DB}
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
if [ "$READONLY" = "1" ] ; then
|
if [ "$READONLY" = "1" ] ; then
|
||||||
echo "read-only" >> /etc/mysql/mariadb.conf.d/settings.cnf
|
echo "read-only" >> /etc/mysql/mariadb.conf.d/custom.cnf
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sudo service cron start
|
sudo service cron start
|
||||||
|
Loading…
Reference in New Issue
Block a user