add nsd package
This commit is contained in:
parent
e48cdf9244
commit
5a026a9a1f
@ -1,7 +1,7 @@
|
|||||||
FROM alpine
|
FROM alpine
|
||||||
MAINTAINER Pierre-Olivier Mercier <nemunaire@nemunai.re>
|
MAINTAINER Pierre-Olivier Mercier <nemunaire@nemunai.re>
|
||||||
|
|
||||||
RUN apk add --no-cache alpine-baselayout bash busybox nsd openssh openrc
|
RUN apk add --no-cache alpine-baselayout bash busybox nsd openssh openssl openrc
|
||||||
|
|
||||||
VOLUME /etc/nsd
|
VOLUME /etc/nsd
|
||||||
|
|
||||||
@ -9,7 +9,8 @@ EXPOSE 53
|
|||||||
EXPOSE 53/udp
|
EXPOSE 53/udp
|
||||||
|
|
||||||
RUN rc-update add nsd default && rc-update add sshd default
|
RUN rc-update add nsd default && rc-update add sshd default
|
||||||
|
COPY init /etc/init.d/nsd
|
||||||
|
|
||||||
CMD ["/sbin/openrc", "default"]
|
CMD ["/sbin/openrc-init"]
|
||||||
|
|
||||||
LABEL org.mobyproject.config='{"binds": ["/etc/resolv.conf:/etc/resolv.conf"], "capabilities": ["CAP_NET_BIND_SERVICE"]}'
|
LABEL org.mobyproject.config='{"binds": ["/etc/resolv.conf:/etc/resolv.conf"], "capabilities": ["CAP_NET_BIND_SERVICE"]}'
|
||||||
|
28
pkg/nsd/init
Executable file
28
pkg/nsd/init
Executable file
@ -0,0 +1,28 @@
|
|||||||
|
#!/sbin/openrc-run
|
||||||
|
|
||||||
|
description="NSD is an authoritative-only, high performance, open source name server"
|
||||||
|
checkconf=/usr/sbin/nsd-checkconf
|
||||||
|
cfgfile=${NSD_CONFIG:-/etc/nsd/nsd.conf}
|
||||||
|
pidfile=$($checkconf -o pidfile $cfgfile)
|
||||||
|
pidfile=${pidfile:-/var/run/nsd/nsd.pid}
|
||||||
|
command=/usr/sbin/nsd
|
||||||
|
command_args=""
|
||||||
|
|
||||||
|
depend() {
|
||||||
|
use logger
|
||||||
|
}
|
||||||
|
|
||||||
|
start_pre() {
|
||||||
|
[ -f /etc/nsd/nsd.conf ] || {
|
||||||
|
cp -r /etc/nsd.sample/* /etc/nsd/
|
||||||
|
nsd-control-setup
|
||||||
|
}
|
||||||
|
|
||||||
|
ebegin
|
||||||
|
checkpath --directory --owner nsd:nsd ${pidfile%/*}
|
||||||
|
checkpath --directory --owner nsd:nsd /var/db/nsd/
|
||||||
|
$checkconf $cfgfile
|
||||||
|
[ "$cfgfile" = "/etc/nsd/nsd.conf" ] || command_args="$command_args -c $cfgfile"
|
||||||
|
[ "$pidfile" = "/var/run/nsd/nsd.pid" ] || command_args="$command_args -P $pidfile"
|
||||||
|
eend $?
|
||||||
|
}
|
Reference in New Issue
Block a user