fix mysql custom parameters
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing

This commit is contained in:
Paolo Asperti 2019-11-25 18:54:15 +01:00
parent fc7b026b0a
commit 989f283b6f
Signed by: paspo
GPG Key ID: 06D46905D19D5182
3 changed files with 11 additions and 5 deletions

View File

@ -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
View File

@ -0,0 +1,4 @@
[mysqld]
server_id=33
replicate-do-db=
read-only

View File

@ -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