-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Updated the base image to debian:bullseye. * Updated create_zone_config.sh to be able to run outside the container. * Removed the zones.conf generation from the entrypoint * Start the container as the unbound user * Updated to logging.conf * Set the pidfile /tmp/unbound.pid * Added remote-control.conf * Updated the documentation
- Loading branch information
Showing
7 changed files
with
148 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
ARG BASE_IMAGE=debian:buster | ||
ARG BASE_IMAGE=debian:bullseye | ||
FROM $BASE_IMAGE | ||
LABEL maintainer "staf wagemakers <[email protected]>" | ||
|
||
|
@@ -12,31 +12,47 @@ RUN apt-get install unbound-anchor -y | |
RUN apt-get install unbound-host -y | ||
RUN apt-get install dns-root-data -y | ||
|
||
# get unbound key | ||
RUN unbound-anchor -v -4 || unbound-anchor -v -4 | ||
RUN chown root:unbound /etc/unbound/*.key | ||
RUN chmod 0650 /etc/unbound/*.key | ||
RUN chown root:unbound /etc/unbound/*.pem | ||
RUN chmod 0650 /etc/unbound/*.pem | ||
|
||
# config | ||
COPY etc/unbound/unbound.conf.d/* /etc/unbound/unbound.conf.d/ | ||
RUN chown root:unbound /etc/unbound/unbound.conf.d/* | ||
RUN chmod 640 /etc/unbound/unbound.conf.d/* | ||
# get unbound key | ||
|
||
RUN unbound-anchor -v || unbound-anchor -v | ||
RUN chown root:unbound /etc/unbound/unbound.conf | ||
RUN chmod 640 /etc/unbound/unbound.conf | ||
|
||
# setup local lan server | ||
# copy the required scripts | ||
RUN mkdir -p /home/unbound/scripts | ||
RUN chown -R root:unbound /home/unbound/ | ||
|
||
COPY scripts/* /home/unbound/scripts/ | ||
RUN chown root:unbound /home/unbound/scripts/* | ||
RUN chmod 550 /home/unbound/scripts/* | ||
|
||
# setup local lan server | ||
RUN mkdir /etc/unbound/zones/ | ||
RUN chown root:unbound /etc/unbound/zones/ | ||
|
||
COPY etc/unbound/zones/* /etc/unbound/zones/ | ||
RUN chown root:unbound /etc/unbound/zones/* | ||
RUN chmod 640 /etc/unbound/zones/* | ||
|
||
RUN mkdir /root/scripts | ||
COPY scripts/* /root/scripts/ | ||
RUN chown root:root /root/scripts/* | ||
RUN chmod 500 /root/scripts/* | ||
RUN touch /etc/unbound/unbound.conf.d/zones.conf | ||
RUN /home/unbound/scripts/create_zone_config.sh | ||
RUN chown root:unbound /etc/unbound/unbound.conf.d/zones.conf | ||
RUN chmod 640 /etc/unbound/unbound.conf.d/zones.conf | ||
|
||
EXPOSE 5353/tcp | ||
EXPOSE 5353/udp | ||
EXPOSE 8953/tcp | ||
EXPOSE 8953/udp | ||
|
||
ENTRYPOINT ["/root/scripts/entrypoint.sh"] | ||
USER unbound | ||
WORKDIR /home/unbound | ||
|
||
ENTRYPOINT ["/home/unbound/scripts/entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
log-local-actions: no | ||
log-queries: no | ||
log-replies: no | ||
log-servfail: no | ||
logfile: "" | ||
verbosity: 0 | ||
use-syslog: no | ||
server: | ||
log-local-actions: no | ||
log-queries: no | ||
log-replies: no | ||
log-servfail: no | ||
logfile: "" | ||
verbosity: 0 | ||
use-syslog: no |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
server: | ||
pidfile: /tmp/unbound.pid |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
remote-control: | ||
control-enable: yes | ||
control-interface: 0.0.0.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,3 @@ | ||
#!/bin/bash | ||
|
||
/root/scripts/create_zone_config.sh || { | ||
echo "ERROR: failed to create zone configuration" | ||
exit 1 | ||
} | ||
#!/bin/sh | ||
|
||
unbound -c /etc/unbound/unbound.conf -d |