Major Upgrade - added very detailed configs for many scenarios, with lots of examples. The server is now fully functional for an authoritative master and a recursive/forwarding cacher. You can still mount over the /etc/bind and /var/bind directories and override everything yourself. This should help many users who did not know where to start with bind.
This commit is contained in:
+14
-5
@@ -3,19 +3,28 @@ EXPOSE 53 53/udp
|
||||
|
||||
RUN apk --update upgrade && apk add bind
|
||||
|
||||
RUN mkdir -m 0755 -p /var/run/named && chown -R root:named /var/run/named
|
||||
|
||||
# /var/cache/bind needs to be owned by "bind"
|
||||
# /etc/bind needs to be owned by root, group owned by "bind", and chmod 750
|
||||
# since we are mounting, do it manually
|
||||
# NOTE: Per Dockerfile manual --> need to mkdir the mounted dir to chown
|
||||
RUN mkdir -m 0755 -p /var/cache/bind && touch /var/cache/bind/docker-init && chown -R named:named /var/cache/bind
|
||||
# &
|
||||
# /var/bind needs to be owned by root, group owned by "bind", and chmod 770
|
||||
# since we are mounting, do it manually
|
||||
# NOTE: Per Dockerfile manual --> need to mkdir the mounted dir to chown
|
||||
# &
|
||||
# Get latest bind.keys
|
||||
RUN mkdir -m 0770 -p /etc/bind && chown -R root:named /etc/bind ; \
|
||||
mkdir -m 0770 -p /var/bind && chown -R root:named /var/cache ; \
|
||||
wget -q -O /etc/bind/bind.keys https://ftp.isc.org/isc/bind9/keys/9.11/bind.keys.v9_11 ; \
|
||||
rndc-confgen -a -r /dev/urandom
|
||||
|
||||
COPY configs/. /etc/bind/
|
||||
|
||||
# Mounts
|
||||
# NOTE: Per Dockerfile manual -->
|
||||
# "if any build steps change the data within the volume
|
||||
# after it has been declared, those changes will be discarded."
|
||||
VOLUME ["/etc/bind"]
|
||||
VOLUME ["/var/cache/bind"]
|
||||
VOLUME ["/var/bind"]
|
||||
|
||||
COPY entrypoint.sh /
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
Reference in New Issue
Block a user