Regen rndc key on 1st run, fix /var/run/named permissions, set up logging

This commit is contained in:
dave 2015-02-27 19:09:07 -08:00
parent 8e78598d21
commit e7bfb6fae2
1 changed files with 10 additions and 2 deletions

View File

@ -7,11 +7,19 @@ COPY regen-bind-key /start.d/regen-bind-key
# Supervisor script # Supervisor script
COPY bind.conf /etc/supervisor/conf.d/bind.conf COPY bind.conf /etc/supervisor/conf.d/bind.conf
# Install software # Install bind and dns utils
RUN apt-get update ; \ RUN apt-get update ; \
apt-get install -y bind9 dnsutils ; \ apt-get install -y bind9 dnsutils ; \
rm /etc/bind/rndc.key ; \ rm /etc/bind/rndc.key ; \
chmod +x /start.d/regen-bind-key chmod +x /start.d/regen-bind-key ; \
mkdir /var/run/named ; \
chown bind /var/run/named ; \
chgrp bind /var/run/named ; \
touch /var/log/named.log ; \
chgrp bind /var/log/named.log ; \
chmod 775 /var/log/named.log ; \
sed -i -e's/include "\/etc\/bind\/named.conf.options";/logging{\n\tchannel simple_log {\n\t\tfile "\/var\/log\/named.log" versions 3 size 5m;\n\t\tseverity info;\n\t\tprint-time yes;\n\t\tprint-severity yes;\n\t\tprint-category yes;\n\t};\n\tcategory default{\n\t\tsimple_log;\n\t};\n};\ninclude "\/etc\/bind\/named.conf.options";/' /etc/bind/named.conf
# edit named.conf to use the above log file
# DNS port # DNS port
EXPOSE 53/udp EXPOSE 53/udp