2017-03-14 08:37:37 +00:00
|
|
|
FROM alpine:latest
|
|
|
|
EXPOSE 53 53/udp
|
|
|
|
|
2019-06-26 20:07:57 +00:00
|
|
|
RUN apk --update upgrade && apk add bind bind-tools bind-plugins
|
2017-03-14 08:37:37 +00:00
|
|
|
|
2018-02-13 04:35:24 +00:00
|
|
|
# /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
|
|
|
|
# &
|
|
|
|
# /var/bind needs to be owned by root, group owned by "bind", and chmod 770
|
2017-03-14 08:37:37 +00:00
|
|
|
# since we are mounting, do it manually
|
|
|
|
# NOTE: Per Dockerfile manual --> need to mkdir the mounted dir to chown
|
2018-02-13 04:35:24 +00:00
|
|
|
# &
|
|
|
|
# Get latest bind.keys
|
|
|
|
RUN mkdir -m 0770 -p /etc/bind && chown -R root:named /etc/bind ; \
|
2019-05-04 06:25:54 +00:00
|
|
|
mkdir -m 0770 -p /var/cache/bind && chown -R named:named /var/cache/bind ; \
|
2018-02-13 04:35:24 +00:00
|
|
|
wget -q -O /etc/bind/bind.keys https://ftp.isc.org/isc/bind9/keys/9.11/bind.keys.v9_11 ; \
|
2019-06-26 05:34:19 +00:00
|
|
|
rndc-confgen -a
|
2018-02-13 04:35:24 +00:00
|
|
|
|
|
|
|
COPY configs/. /etc/bind/
|
2017-03-14 08:37:37 +00:00
|
|
|
|
|
|
|
# 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"]
|
2018-02-28 15:50:35 +00:00
|
|
|
VOLUME ["/var/cache/bind"]
|
2017-03-14 08:37:37 +00:00
|
|
|
|
|
|
|
COPY entrypoint.sh /
|
|
|
|
ENTRYPOINT ["/entrypoint.sh"]
|