23 Commits
v9.19 ... v9.21

Author SHA1 Message Date
Ondřej Surý
5106322229 Merge branch 'feature/multistage-build-9.20' into 'v9.20'
Multistage build 9.20

See merge request isc-projects/bind9-docker!1
2025-03-21 02:44:18 +01:00
Andoni Duarte Pintado
3e7b779362 Version bump to 9.21.6 2025-03-19 16:34:30 +01:00
Ondřej Surý
666994badb Use explicit UID/GID 53 (changeable with ARG)
Closes: #62, #60
2025-03-01 07:24:16 +01:00
Ondřej Surý
2ef9e5538e Use LABEL org.opencontainers.image.authors instead of MAINTAINERS 2025-03-01 07:17:32 +01:00
Andoni Duarte Pintado
85b20cc6c1 Version bump to 9.21.5 2025-02-19 17:02:38 +01:00
Nicki Křížek
3f6ba9ff11 Version bump to 9.21.4 2025-01-29 19:04:58 +01:00
Ondřej Surý
490206ec95 Version bump to 9.21.3 2024-12-13 10:39:32 +01:00
Michal Nowak
cb3c182260 Version bump to 9.21.2 2024-10-16 17:24:11 +02:00
Nicki Křížek
16fc28c767 Version bump to 9.21.1 2024-09-18 16:22:43 +02:00
Ondřej Surý
9291754e33 Slightly reduce the image and the layers size 2024-08-27 19:15:33 +02:00
Ondřej Surý
5e53cd4325 Log everything into /var/log/bind/default.log 2024-08-27 18:54:53 +02:00
Ondřej Surý
0a33f9d7e4 Combine ENTRYPOINT and CMD, so the config file and -f can be easily overriden 2024-08-27 10:15:15 +02:00
Ondřej Surý
44ab7a35f1 Use ENTRYPOINT instead of CMD 2024-08-27 10:11:51 +02:00
Ondřej Surý
66cc4679ba Don't generate the rndc.key file - it would be same in all images 2024-08-27 10:11:51 +02:00
Ondřej Surý
fcfe2a0563 Use ADD command with checksum instead of curl to download sources 2024-08-27 10:11:49 +02:00
Ondřej Surý
32db9d5987 Fix the DoT and DoH listen v4 and v6 configuration 2024-08-27 08:30:55 +02:00
Ondřej Surý
61bbe666d5 Enable DoT and DoH with ephemeral certificates 2024-08-27 08:19:33 +02:00
Ondřej Surý
523ee6b829 Expose DoT and DoH ports 2024-08-27 08:09:14 +02:00
Ondřej Surý
0a7b086d25 Replace static version number in the directory name with the shell variable 2024-08-27 07:51:10 +02:00
Ondřej Surý
77cf62a8a4 Fix permissions on /etc/bind/rndc.key 2024-08-27 07:33:27 +02:00
Ondřej Surý
93e122b75a Switch BIND 9.21 to alpine:latest and build from source 2024-08-27 07:18:49 +02:00
Ondřej Surý
4b3e016b9a 1:9.20.1-1+ubuntu24.04.1+deb.sury.org+1 2024-08-21 15:21:48 +02:00
Ondřej Surý
a8e07174f5 Bump to 1:9.20.0-1+ubuntu24.04.1+deb.sury.org+1 @ Ubuntu 24.04 2024-07-23 15:50:00 +02:00
2 changed files with 128 additions and 19 deletions

View File

@@ -1,35 +1,130 @@
FROM ubuntu:jammy
MAINTAINER BIND 9 Developers <bind9-dev@isc.org>
# Create common base
FROM alpine:latest AS base
LABEL org.opencontainers.image.authors="BIND 9 Developers <bind9-dev@isc.org>"
ENV DEBIAN_FRONTEND noninteractive
ENV LC_ALL C.UTF-8
ENV LC_ALL=C.UTF-8
ARG DEB_VERSION=1:9.19.24-2+ubuntu22.04.1+deb.sury.org+1
ARG UID=53
ARG GID=53
# Install add-apt-repository command
RUN apt-get -qqqy update
RUN apt-get -qqqy dist-upgrade
RUN apt-get -qqqy install --no-install-recommends apt-utils software-properties-common dctrl-tools gpg-agent
ARG BIND9_VERSION=9.21.6
ARG BIND9_CHECKSUM=ff9722bdb353df442ca95444148aa23e3d16153e4576d2bdaa008fa7f37e019c
# Add the BIND 9 APT Repository
RUN add-apt-repository -y ppa:isc/bind-dev
RUN apk --no-cache update
RUN apk --no-cache upgrade
# Install BIND 9
RUN apt-get -qqqy update
RUN apt-get -qqqy dist-upgrade
RUN apt-get -qqqy install bind9=$DEB_VERSION bind9utils=$DEB_VERSION
# Build BIND 9
FROM base AS builder
# Now remove the pkexec that got pulled as dependency to software-properties-common
RUN apt-get --purge -y autoremove policykit-1
RUN apk --no-cache add \
autoconf \
automake \
build-base \
fstrm \
fstrm-dev \
jemalloc \
jemalloc-dev \
json-c \
json-c-dev \
krb5-dev \
krb5-libs \
libcap-dev \
libcap2 \
libidn2 \
libidn2-dev \
libmaxminddb-dev \
libmaxminddb-libs \
libtool \
libuv \
libuv-dbg \
libuv-dev \
libxml2 \
libxml2-dbg \
libxml2-dev \
libxslt \
lmdb \
lmdb-dev \
make \
musl-dbg \
nghttp2-dev \
nghttp2-libs \
openssl-dbg \
openssl-dev \
procps \
protobuf-c \
protobuf-c-dev \
tzdata \
userspace-rcu \
userspace-rcu-dev
RUN mkdir -p /usr/src
ADD https://downloads.isc.org/isc/bind9/${BIND9_VERSION}/bind-${BIND9_VERSION}.tar.xz /usr/src
RUN cd /usr/src && \
( echo "${BIND9_CHECKSUM} bind-${BIND9_VERSION}.tar.xz" | sha256sum -c - ) && \
tar -xJf bind-${BIND9_VERSION}.tar.xz && \
cd /usr/src/bind-${BIND9_VERSION} && \
./configure --prefix /usr \
--sysconfdir=/etc/bind \
--localstatedir=/ \
--enable-shared \
--disable-static \
--with-gssapi \
--with-libidn2 \
--with-json-c \
--with-lmdb=/usr \
--with-gnu-ld \
--with-maxminddb \
--enable-dnstap && \
make -j && \
make install DESTDIR=/dist && \
rm -rf /usr/src
# Create final image
FROM base
RUN apk --no-cache add \
fstrm \
jemalloc \
json-c \
krb5-libs \
libcap2 \
libidn2 \
libmaxminddb-libs \
libuv \
libxml2 \
lmdb \
nghttp2-libs \
procps \
protobuf-c \
tzdata \
userspace-rcu
# Copy binaries from previous stage
COPY --from=builder /dist/ /
# Create user and group
RUN addgroup -S -g ${GID} bind && adduser -S -u ${UID} -H -h /var/cache/bind -G bind bind
# Create default configuration file
RUN mkdir -p /etc/bind && chown root:bind /etc/bind/ && chmod 755 /etc/bind
COPY named.conf /etc/bind
RUN chown root:bind /etc/bind/named.conf && chmod 644 /etc/bind/named.conf
# Create working directory
RUN mkdir -p /var/cache/bind && chown bind:bind /var/cache/bind && chmod 755 /var/cache/bind
# Create directory to store secondary zones
RUN mkdir -p /var/lib/bind && chown bind:bind /var/lib/bind && chmod 755 /var/lib/bind
# Create log directory
RUN mkdir -p /var/log/bind && chown bind:bind /var/log/bind && chmod 755 /var/log/bind
# Create PID directory
RUN mkdir -p /run/named && chown bind:bind /run/named && chmod 755 /run/named
VOLUME ["/etc/bind", "/var/cache/bind", "/var/lib/bind", "/var/log"]
EXPOSE 53/udp 53/tcp 953/tcp
EXPOSE 53/udp 53/tcp 953/tcp 853/tcp 443/tcp
CMD ["/usr/sbin/named", "-f", "-c", "/etc/bind/named.conf", "-u", "bind"]
ENTRYPOINT ["/usr/sbin/named", "-u", "bind"]
CMD ["-f", "-c", "/etc/bind/named.conf", "-L", "/var/log/bind/default.log"]

14
named.conf Normal file
View File

@@ -0,0 +1,14 @@
http local {
endpoints { "/dns-query"; };
};
options {
directory "/var/cache/bind";
listen-on { any; };
listen-on-v6 { any; };
listen-on tls ephemeral { any; };
listen-on-v6 tls ephemeral { any; };
listen-on tls ephemeral http local { any; };
listen-on-v6 tls ephemeral http local { any; };
};