Design for running on top of existing config
This commit is contained in:
parent
7234f5e38d
commit
6267e357ed
12
Dockerfile
12
Dockerfile
|
@ -1,8 +1,11 @@
|
||||||
FROM ubuntu:trusty
|
FROM ubuntu:trusty
|
||||||
MAINTAINER Dave P
|
MAINTAINER Dave P
|
||||||
|
|
||||||
|
ADD start /start
|
||||||
|
|
||||||
# Install bind and dns utils
|
# Install bind and dns utils
|
||||||
RUN apt-get update ; \
|
RUN chmod +x /start ; \
|
||||||
|
apt-get update ; \
|
||||||
apt-get install -y supervisor bind9 dnsutils ; \
|
apt-get install -y supervisor bind9 dnsutils ; \
|
||||||
rm /etc/bind/rndc.key ; \
|
rm /etc/bind/rndc.key ; \
|
||||||
mkdir /var/run/named ; \
|
mkdir /var/run/named ; \
|
||||||
|
@ -11,8 +14,8 @@ RUN apt-get update ; \
|
||||||
touch /var/log/named.log ; \
|
touch /var/log/named.log ; \
|
||||||
chgrp bind /var/log/named.log ; \
|
chgrp bind /var/log/named.log ; \
|
||||||
chmod 775 /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 ; \
|
mkdir /start.d ; \
|
||||||
mkdir /start.d
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
# Supervisor script
|
# Supervisor script
|
||||||
ADD bind.conf /etc/supervisor/conf.d/bind.conf
|
ADD bind.conf /etc/supervisor/conf.d/bind.conf
|
||||||
|
@ -21,8 +24,7 @@ ADD supervisor.conf /etc/supervisor/conf.d/supervisor.conf
|
||||||
# Bind setup script
|
# Bind setup script
|
||||||
ADD regen-bind-key /start.d/regen-bind-key
|
ADD regen-bind-key /start.d/regen-bind-key
|
||||||
|
|
||||||
ADD start /start
|
|
||||||
|
|
||||||
# DNS port
|
# DNS port
|
||||||
EXPOSE 53/udp
|
EXPOSE 53/udp
|
||||||
|
|
||||||
|
ENTRYPOINT ["/start"]
|
|
@ -1,7 +1,6 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# reconfigure bind - regenerates secret keys
|
# reconfigure bind - regenerates secret keys
|
||||||
rndc-confgen -a -r /dev/urandom
|
if [ ! -f /etc/bind/rndc.key ]; then
|
||||||
|
rndc-confgen -a -r /dev/urandom
|
||||||
# Only run once
|
fi
|
||||||
rm /start.d/regen-bind-key
|
|
||||||
|
|
Loading…
Reference in New Issue