Bind / Named in a container
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

30 lines
1.0 KiB

  1. FROM ubuntu:trusty
  2. MAINTAINER Dave P
  3. # Install bind and dns utils
  4. RUN apt-get update ; \
  5. apt-get install -y supervisor bind9 dnsutils ; \
  6. rm /etc/bind/rndc.key ; \
  7. chmod +x /start.d/regen-bind-key ; \
  8. mkdir /var/run/named ; \
  9. chown bind /var/run/named ; \
  10. chgrp bind /var/run/named ; \
  11. touch /var/log/named.log ; \
  12. chgrp bind /var/log/named.log ; \
  13. chmod 775 /var/log/named.log ; \
  14. 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 ; \
  15. mkdir /start.d
  16. # Supervisor script
  17. ADD bind.conf /etc/supervisor/conf.d/bind.conf
  18. ADD supervisor.conf /etc/supervisor/conf.d/supervisor.conf
  19. # Bind setup script
  20. ADD regen-bind-key /start.d/regen-bind-key
  21. ADD start /start
  22. # DNS port
  23. EXPOSE 53/udp