FROM alpine:latest

RUN apk update
RUN apk add --no-cache unbound bind-tools iputils

RUN mkdir -p /etc/unbound
RUN chown root:unbound /etc/unbound
RUN chmod 775 /etc/unbound

ADD https://www.internic.net/domain/named.root /etc/root.hints
RUN chmod -R a+r /etc/root.hints

VOLUME [ "/etc/unbound" ]

ENTRYPOINT ["unbound", "-d"]
