Compare commits
2 Commits
c6af6a69eb
...
1600112965
Author | SHA1 | Date | |
---|---|---|---|
1600112965 | |||
c1cd0ea0d4 |
@ -2,7 +2,7 @@ FROM alpine:latest
|
|||||||
|
|
||||||
RUN \
|
RUN \
|
||||||
apk --update upgrade && \
|
apk --update upgrade && \
|
||||||
apk add unbound bind-tools && \
|
apk add unbound bind-tools tini && \
|
||||||
wget -O /etc/unbound/named.cache ftp://ftp.internic.net//domain/named.cache
|
wget -O /etc/unbound/named.cache ftp://ftp.internic.net//domain/named.cache
|
||||||
|
|
||||||
COPY rootfs /
|
COPY rootfs /
|
||||||
@ -10,4 +10,4 @@ COPY rootfs /
|
|||||||
HEALTHCHECK --interval=30s --start-period=5s --timeout=10s \
|
HEALTHCHECK --interval=30s --start-period=5s --timeout=10s \
|
||||||
CMD /usr/bin/host -T -p 1053 asperti.com 127.0.0.1
|
CMD /usr/bin/host -T -p 1053 asperti.com 127.0.0.1
|
||||||
|
|
||||||
ENTRYPOINT ["/usr/sbin/unbound", "-d"]
|
ENTRYPOINT ["/sbin/tini", "--", "/bin/sh", "/app/entrypoint.sh"]
|
||||||
|
39
rootfs/app/entrypoint.sh
Executable file
39
rootfs/app/entrypoint.sh
Executable file
@ -0,0 +1,39 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
LOGS=${LOGS:-false}
|
||||||
|
LOGDIR=${LOGDIR:-/logs}
|
||||||
|
PORT=${PORT:-1053}
|
||||||
|
VERBOSITY=${VERBOSITY:-1}
|
||||||
|
|
||||||
|
# set logs
|
||||||
|
if [ "${LOGS}" = true ] ; then
|
||||||
|
mkdir -p "${LOGDIR}"
|
||||||
|
chown unbound:unbound "${LOGDIR}"
|
||||||
|
cat >> /etc/unbound/unbound.conf.d/logs.conf << EOF
|
||||||
|
server:
|
||||||
|
verbosity: ${VERBOSITY}
|
||||||
|
log-queries: yes
|
||||||
|
log-replies: yes
|
||||||
|
logfile: "${LOGDIR}/unbound.log"
|
||||||
|
log-time-ascii: yes
|
||||||
|
log-servfail: yes
|
||||||
|
log-local-actions: yes
|
||||||
|
EOF
|
||||||
|
else
|
||||||
|
cat >> /etc/unbound/unbound.conf.d/logs.conf << EOF
|
||||||
|
server:
|
||||||
|
verbosity: ${VERBOSITY}
|
||||||
|
log-queries: no
|
||||||
|
log-replies: no
|
||||||
|
logfile: ""
|
||||||
|
EOF
|
||||||
|
fi
|
||||||
|
|
||||||
|
# set port
|
||||||
|
cat >> /etc/unbound/unbound.conf.d/port.conf << EOF
|
||||||
|
server:
|
||||||
|
port: ${PORT}
|
||||||
|
EOF
|
||||||
|
|
||||||
|
# start unbound
|
||||||
|
/usr/sbin/unbound -d
|
@ -1,6 +1,5 @@
|
|||||||
server:
|
server:
|
||||||
interface: 0.0.0.0
|
interface: 0.0.0.0
|
||||||
port: 1053
|
|
||||||
do-ip4: yes
|
do-ip4: yes
|
||||||
do-ip6: no
|
do-ip6: no
|
||||||
do-udp: yes
|
do-udp: yes
|
||||||
@ -10,14 +9,6 @@ server:
|
|||||||
cache-max-ttl: 86400
|
cache-max-ttl: 86400
|
||||||
prefetch: yes
|
prefetch: yes
|
||||||
num-threads: 4
|
num-threads: 4
|
||||||
verbosity: 1
|
|
||||||
# log-queries: yes
|
|
||||||
log-queries: no
|
|
||||||
# log-replies: yes
|
|
||||||
logfile: ""
|
|
||||||
log-time-ascii: yes
|
|
||||||
log-servfail: yes
|
|
||||||
# log-local-actions: yes
|
|
||||||
use-syslog: no
|
use-syslog: no
|
||||||
msg-cache-slabs: 8
|
msg-cache-slabs: 8
|
||||||
rrset-cache-slabs: 8
|
rrset-cache-slabs: 8
|
||||||
@ -36,3 +27,4 @@ dynlib:
|
|||||||
remote-control:
|
remote-control:
|
||||||
control-enable: yes
|
control-enable: yes
|
||||||
control-interface: /run/unbound.control.sock
|
control-interface: /run/unbound.control.sock
|
||||||
|
include-toplevel: "/etc/unbound/unbound.conf.d/*.conf"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user