From 5a61e5047b5fda5bfadf75b4844c797f6d9ad9e4 Mon Sep 17 00:00:00 2001 From: Cory Date: Mon, 14 Dec 2020 11:27:06 +1030 Subject: [PATCH] Resolve error 'the working directory is not writable' by switching into the /tmp/bind directory before executing the bind process --- container/entrypoint.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/container/entrypoint.sh b/container/entrypoint.sh index 2460bc8..df3e5e9 100755 --- a/container/entrypoint.sh +++ b/container/entrypoint.sh @@ -3,10 +3,12 @@ OPTIONS=$@ # "Run Time" changes - needed for when creating a *new* directory/first-time volume map # A great example of this is "/var/cache/bind" for dynamic configs, and mapping it in # The first time around, it will not be owned by named:named, and thus it won't be writable +mkdir /tmp/bind chown -R root:named /etc/bind /var/run/named -chown -R named:named /var/cache/bind +chown -R named:named /var/cache/bind /tmp/bind chmod -R 770 /etc/bind /var/cache/bind /var/run/named find /etc/bind /var/cache/bind -type f -exec chmod 640 -- {} + # By default - run in foreground and log to STDERR (console) # can be changed by running container with: -e "BIND_LOG=-f" +cd /tmp/bind exec /usr/sbin/named -c /etc/bind/named.conf $BIND_LOG -u named $OPTIONS