From 0f2546631a62ac2888fed09ebb8dd5d78d05cc76 Mon Sep 17 00:00:00 2001 From: Disassembler Date: Sat, 27 Jan 2018 14:13:59 +0100 Subject: [PATCH] Make a proper conf mount for MariaDB --- mariadb.sh | 6 +++--- mariadb/etc/init.d/mariadb | 2 +- mariadb/srv/mariadb/{ => conf}/my.cnf | 0 3 files changed, 4 insertions(+), 4 deletions(-) rename mariadb/srv/mariadb/{ => conf}/my.cnf (100%) diff --git a/mariadb.sh b/mariadb.sh index 31c3720..9176294 100755 --- a/mariadb.sh +++ b/mariadb.sh @@ -6,16 +6,16 @@ SOURCE_DIR=$(realpath $(dirname "${0}"))/mariadb docker build -t mariadb ${SOURCE_DIR} # Create MariaDB instance -mkdir -p /srv/mariadb/data +mkdir -p /srv/mariadb/conf /srv/mariadb/data chown 3306:3306 /srv/mariadb/data docker run --rm --name mariadb -h mariadb -v /srv/mariadb/data:/var/lib/mysql mariadb mysql_install_db --user=mysql # Configure MariaDB -cp ${SOURCE_DIR}/srv/mariadb/my.cnf /srv/mariadb/my.cnf +cp ${SOURCE_DIR}/srv/mariadb/conf/my.cnf /srv/mariadb/conf/my.cnf # Enable query logging. Only if the DEBUG environment variable is set if [ ${DEBUG:-0} -eq 1 ]; then - sed -i 's/#general_log/general_log/g' /srv/mariadb/my.cnf + sed -i 's/#general_log/general_log/g' /srv/mariadb/conf/my.cnf fi # Configure MariaDB service diff --git a/mariadb/etc/init.d/mariadb b/mariadb/etc/init.d/mariadb index 55fc7c8..d02bf09 100755 --- a/mariadb/etc/init.d/mariadb +++ b/mariadb/etc/init.d/mariadb @@ -11,7 +11,7 @@ start() { /usr/bin/docker run -d --rm \ --name mariadb \ -h mariadb \ - -v /srv/mariadb/my.cnf:/etc/mysql/my.cnf \ + -v /srv/mariadb/conf:/etc/mysql \ -v /srv/mariadb/data:/var/lib/mysql \ mariadb } diff --git a/mariadb/srv/mariadb/my.cnf b/mariadb/srv/mariadb/conf/my.cnf similarity index 100% rename from mariadb/srv/mariadb/my.cnf rename to mariadb/srv/mariadb/conf/my.cnf