2 Commits
3 changed files with 24 additions and 4 deletions
+16 -2
View File
@@ -1,6 +1,6 @@
### ISC BIND9 Container (Stable: 9.14.8_xx) built on top of Alpine ### ISC BIND9 Container (Stable: 9.14.8_xx) built on top of Alpine
### Last update: 2-6-20 ### Last update: 2-6-20
### Latest Stable Docker Tag: 9.14.8-r0 ### Latest Stable Docker Tag: 9.14.8-r5
NOTE: "Last Update" is the date of the latest DockerHub build. NOTE: "Last Update" is the date of the latest DockerHub build.
@@ -154,6 +154,20 @@ logging {
category default { stdout; }; category default { stdout; };
}; };
For more information, see: https://www.slideshare.net/MenandMice/bind-9-logging-best-practices
## How do I just change Bind STDERR to STDOUT logging?
There is now a "BIND_LOG" ENV (environment) variable for logging
Environment variables can both have a default and be customized at run time.
```
"-g" = (default) Run the server in the foreground and force all logging stderr.
"-f" = Run the server in the foreground
``` ```
For more information, see: https://www.slideshare.net/MenandMice/bind-9-logging-best-practices By default, the "-g" value is set, as that logs all to STDERR.
You can now override it with "-f" by passing `-e "BIND_LOG=-f"` to `docker run`
+5
View File
@@ -3,6 +3,11 @@ EXPOSE 53 53/udp
RUN apk --update upgrade && apk add bind bind-tools bind-plugins RUN apk --update upgrade && apk add bind bind-tools bind-plugins
# BIND Log Options - you can override at run time
# "-g" = (default) Run the server in the foreground and force all logging stderr.
# "-f" = Run the server in the foreground
env BIND_LOG -g
# /etc/bind needs to be owned by root, group owned by "bind", and chmod 750 # /etc/bind needs to be owned by root, group owned by "bind", and chmod 750
# since we are mounting, do it manually # since we are mounting, do it manually
# NOTE: Per Dockerfile manual --> need to mkdir the mounted dir to chown # NOTE: Per Dockerfile manual --> need to mkdir the mounted dir to chown
+3 -2
View File
@@ -4,5 +4,6 @@ chown -R root:named /etc/bind /var/run/named
chown -R named:named /var/cache/bind chown -R named:named /var/cache/bind
chmod -R 770 /var/cache/bind /var/run/named chmod -R 770 /var/cache/bind /var/run/named
chmod -R 750 /etc/bind chmod -R 750 /etc/bind
# Run in foreground and log to STDERR (console): # By default - run in foreground and log to STDERR (console)
exec /usr/sbin/named -c /etc/bind/named.conf -g -u named $OPTIONS # can be changed by running container with: -e "BIND_LOG=-f"
exec /usr/sbin/named -c /etc/bind/named.conf $BIND_LOG -u named $OPTIONS