Remove base image dependency
This commit is contained in:
parent
e7bfb6fae2
commit
4e04c84a5f
23
Dockerfile
23
Dockerfile
|
@ -1,15 +1,9 @@
|
||||||
FROM basessh
|
FROM ubuntu:trusty
|
||||||
MAINTAINER Dave P
|
MAINTAINER Dave P
|
||||||
|
|
||||||
# Bind setup script
|
|
||||||
COPY regen-bind-key /start.d/regen-bind-key
|
|
||||||
|
|
||||||
# Supervisor script
|
|
||||||
COPY bind.conf /etc/supervisor/conf.d/bind.conf
|
|
||||||
|
|
||||||
# Install bind and dns utils
|
# Install bind and dns utils
|
||||||
RUN apt-get update ; \
|
RUN apt-get update ; \
|
||||||
apt-get install -y bind9 dnsutils ; \
|
apt-get install -y supervisor 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 ; \
|
mkdir /var/run/named ; \
|
||||||
|
@ -18,8 +12,17 @@ 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
|
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
|
mkdir /start.d
|
||||||
|
|
||||||
|
# Supervisor script
|
||||||
|
ADD bind.conf /etc/supervisor/conf.d/bind.conf
|
||||||
|
ADD supervisor.conf /etc/supervisor/conf.d/supervisor.conf
|
||||||
|
|
||||||
|
# Bind setup script
|
||||||
|
ADD regen-bind-key /start.d/regen-bind-key
|
||||||
|
|
||||||
|
ADD start /start
|
||||||
|
|
||||||
# DNS port
|
# DNS port
|
||||||
EXPOSE 53/udp
|
EXPOSE 53/udp
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# reconfigure bind - regenerates secret keys
|
# reconfigure bind - regenerates secret keys
|
||||||
dpkg-reconfigure bind9
|
rndc-confgen -a -r /dev/urandom
|
||||||
|
|
||||||
# Only run once
|
# Only run once
|
||||||
rm /start.d/regen-bind-key
|
rm /start.d/regen-bind-key
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# run everything in start.d
|
||||||
|
find /start.d -type f -executable -exec {} \;
|
||||||
|
|
||||||
|
# Cleanly kill supervisor when container is stopped
|
||||||
|
trap 'kill $(jobs -p)' EXIT
|
||||||
|
|
||||||
|
# start services
|
||||||
|
supervisord
|
|
@ -0,0 +1,2 @@
|
||||||
|
[supervisord]
|
||||||
|
nodaemon=true
|
Loading…
Reference in New Issue