Skip to content

Commit

Permalink
fix logging
Browse files Browse the repository at this point in the history
  • Loading branch information
matjazp committed May 13, 2021
1 parent ef52b7d commit f2efae7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM internetsystemsconsortium/bind9:9.16
LABEL org.opencontainers.image.source="https://github.com/matjazp/ubuntu-bind"
RUN apt-get -qqqy update && apt-get -qqqy install nano dnsutils iputils-ping ifupdown
#RUN echo include "/etc/bind/named.conf.log"; >> /etc/bind/named.conf
#RUN mkdir -p /var/log/bind
#RUN chown bind:bind /var/log/bind
#COPY --chown=root:bind named.conf.log /etc/bind/named.conf.log
CMD [ "bash" ]
RUN apt-get -qqy update && apt-get -qqy install dnsutils iputils-ping ifupdown less nano
COPY startup.sh /startup.sh
RUN chmod +x /startup.sh
COPY --chown=root:bind named.conf.log /etc/named.conf.log
ENTRYPOINT [ "./startup.sh"]
CMD [ "/usr/bin/bash" ]
10 changes: 10 additions & 0 deletions startup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#! /usr/bin/bash
# make sure log file is included only once
grep -Fxq 'include "/etc/named.conf.log";' /etc/bind/named.conf || echo 'include "/etc/named.conf.log";' >> /etc/bind/named.conf
# echo 'include "/etc/named.conf.log";' >> /etc/bind/named.conf
if [ ! -d "/var/log/bind" ]; then
mkdir -p /var/log/bind
chown bind:bind /var/log/bind
fi

exec "$@"

0 comments on commit f2efae7

Please sign in to comment.