diff --git a/Dockerfile b/Dockerfile index f1e2257..c23d9bc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,12 @@ FROM mariadb:10 -RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -q -y cron automysqlbackup +RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -q -y cron sudo automysqlbackup RUN touch /etc/mysql/mariadb.conf.d/settings.cnf && chown mysql /etc/mysql/mariadb.conf.d/settings.cnf COPY docker-entrypoint.sh /usr/local/bin/ COPY automysqlbackup /etc/default +COPY sudoers /etc/sudoers.d/mysudoers + #HEALTHCHECK diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 5cdfe7d..1190f8a 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -341,6 +341,6 @@ EOF if [ "$READONLY" = "1" ] ; then echo "read-only" >> /etc/mysql/mariadb.conf.d/settings.cnf fi - service cron start + sudo service cron start _main "$@" fi diff --git a/sudoers b/sudoers new file mode 100644 index 0000000..7f1cddb --- /dev/null +++ b/sudoers @@ -0,0 +1,2 @@ +mysql ALL = (ALL) NOPASSWD: /usr/sbin/service cron start +