└── Dockerfile /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:focal 2 | MAINTAINER BIND 9 Developers 3 | 4 | ENV DEBIAN_FRONTEND noninteractive 5 | ENV LC_ALL C.UTF-8 6 | 7 | ARG DEB_VERSION=1:9.16.50-1+ubuntu20.04.1+deb.sury.org+1 8 | 9 | # Install add-apt-repository command 10 | RUN apt-get -qqqy update 11 | RUN apt-get -qqqy dist-upgrade 12 | RUN apt-get -qqqy install --no-install-recommends apt-utils software-properties-common dctrl-tools gpg-agent 13 | 14 | # Add the BIND 9 APT Repository 15 | RUN add-apt-repository -y ppa:isc/bind-esv 16 | 17 | # Install BIND 9 18 | RUN apt-get -qqqy update 19 | RUN apt-get -qqqy dist-upgrade 20 | RUN apt-get -qqqy install bind9=$DEB_VERSION bind9utils=$DEB_VERSION 21 | 22 | # Now remove the pkexec that got pulled as dependency to software-properties-common 23 | RUN apt-get --purge -y autoremove policykit-1 24 | 25 | RUN mkdir -p /etc/bind && chown root:bind /etc/bind/ && chmod 755 /etc/bind 26 | RUN mkdir -p /var/cache/bind && chown bind:bind /var/cache/bind && chmod 755 /var/cache/bind 27 | RUN mkdir -p /var/lib/bind && chown bind:bind /var/lib/bind && chmod 755 /var/lib/bind 28 | RUN mkdir -p /var/log/bind && chown bind:bind /var/log/bind && chmod 755 /var/log/bind 29 | RUN mkdir -p /run/named && chown bind:bind /run/named && chmod 755 /run/named 30 | 31 | VOLUME ["/etc/bind", "/var/cache/bind", "/var/lib/bind", "/var/log"] 32 | 33 | EXPOSE 53/udp 53/tcp 953/tcp 34 | 35 | CMD ["/usr/sbin/named", "-f", "-c", "/etc/bind/named.conf", "-u", "bind"] 36 | --------------------------------------------------------------------------------