From c3f9447a70de43c423ba7248ee3c83c2a320cd83 Mon Sep 17 00:00:00 2001 From: paspo Date: Sun, 24 Nov 2019 10:50:11 +0100 Subject: [PATCH] fix sudoers --- Dockerfile | 4 +++- docker-entrypoint.sh | 2 +- sudoers | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 sudoers 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 +