From 9db03e0eaed63de7aa2d786cb0f6e37e6931558b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Sur=C3=BD?= Date: Wed, 2 Sep 2020 18:58:47 +0200 Subject: [PATCH] Rewrite the Dockerfile to build from Ubuntu and official repositories --- Dockerfile | 74 ++++++++++++++---------------------------------------- 1 file changed, 19 insertions(+), 55 deletions(-) diff --git a/Dockerfile b/Dockerfile index 723a409..5228200 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,60 +1,24 @@ -FROM alpine:latest +FROM ubuntu:focal MAINTAINER BIND 9 Developers -ENV BIND9_VERSION 9.11.11 -RUN apk update -RUN apk add \ - autoconf \ - automake \ - build-base \ - ccache \ - cmocka-dev \ - curl \ - fstrm-dev \ - geoip-dev \ - git \ - gnupg \ - json-c-dev \ - krb5-dev \ - kyua \ - libcap-dev \ - libidn2-dev \ - libmaxminddb-dev \ - libtool \ - libxml2-dev \ - libuv-dev \ - libxslt \ - lmdb-dev \ - make \ - openssl-dev \ - perl \ - perl-digest-hmac \ - perl-json \ - perl-net-dns \ - perl-xml-simple \ - protobuf-c-dev \ - py3-dnspython \ - py3-ply \ - python3 \ - tzdata -RUN curl -sSLO https://ftp.isc.org/isc/bind9/$BIND9_VERSION/bind-$BIND9_VERSION.tar.gz -RUN curl -sSLO https://ftp.isc.org/isc/bind9/$BIND9_VERSION/bind-$BIND9_VERSION.tar.gz.asc -RUN curl -sSL https://ftp.isc.org/isc/pgpkeys/codesign2019.txt | gpg --import -RUN gpg --verify bind-$BIND9_VERSION.tar.gz.asc bind-$BIND9_VERSION.tar.gz || exit 1 -RUN tar -czf bind-$BIND9_VERSION.tar.gz -RUN cd bind-$BIND_VERSION && -Wall -Wextra -O2 -g ./configure --prefix=/usr --includedir=\${prefix}/include --mandir=\${prefix}/share/man --infodir=\${prefix}/share/info --sysconfdir=/etc/bind --localstatedir=/ --disable-silent-rules --libdir=\${prefix}/lib/x86_64-linux-gnu --libexecdir=\${prefix}/lib/x86_64-linux-gnu --disable-maintainer-mode --enable-developer --with-libtool --disable-static --with-cmocka --with-libxml2 --with-json-c --prefix=/usr/local --without-make-clean --sysconfdir=/etc/bind --enable-dnstap --with-libidn2 --with-maxminddb && make && make install -RUN ldconfig -VOLUME ["/etc/bind", "/var/cache/bind", "/var/lib/bind", "/var/log", "/var/run/bind"] -RUN addgroup -S bind && adduser -S bind -G bind -RUN mkdir -p /etc/bind && chown root:bind /etc/bind/ && chmod 750 /etc/bind -RUN mkdir -p /var/cache/bind && chown bind:bind /var/cache/bind && chmod 750 /var/cache/bind -RUN mkdir -p /var/lib/bind && chown bind:bind /var/lib/bind && chmod 750 /var/lib/bind -RUN mkdir -p /var/log/bind && chown bind:bind /var/log/bind && chmod 750 /var/log/bind -RUN mkdir -p /var/run/bind && chown bind:bind /var/run/bind && chmod 750 /var/run/bind +ENV DEBIAN_FRONTEND noninteractive +ENV LC_ALL C.UTF-8 -COPY named.conf /etc/bind/named.conf +RUN apt-get -qqqy update +RUN apt-get -qqqy install apt-utils software-properties-common +RUN add-apt-repository -y ppa:isc/bind +RUN apt-get -qqqy update +RUN apt-get -qqqy dist-upgrade +RUN apt-get -qqqy install bind9 bind9-utils -EXPOSE 53 -EXPOSE 53/udp +VOLUME ["/etc/bind", "/var/cache/bind", "/var/lib/bind", "/var/log", "/run/named"] -CMD ["/usr/sbin/named", "-f", "-c", "/etc/bind/named.conf", "-u", "bind"] +RUN mkdir -p /etc/bind && chown root:bind /etc/bind/ && chmod 755 /etc/bind +RUN mkdir -p /var/cache/bind && chown bind:bind /var/cache/bind && chmod 755 /var/cache/bind +RUN mkdir -p /var/lib/bind && chown bind:bind /var/lib/bind && chmod 755 /var/lib/bind +RUN mkdir -p /var/log/bind && chown bind:bind /var/log/bind && chmod 755 /var/log/bind +RUN mkdir -p /run/named && chown bind:bind /run/named && chmod 755 /run/named + +EXPOSE 53/udp 53/tcp 953/tcp + +CMD ["/usr/sbin/named", "-g", "-c", "/etc/bind/named.conf", "-u", "bind"]