2022-01-21 23:23:55 +00:00
|
|
|
FROM alpine:3.15.0
|
|
|
|
|
2022-01-22 01:17:59 +00:00
|
|
|
# Install required dependencies and build unbound (and install bind-tools for dig in healthcheck)
|
|
|
|
RUN apk --update add --no-cache alpine-sdk bind-tools expat-dev git openssl-dev && \
|
|
|
|
# Clone and build unbound source (https://github.com/NLnetLabs/unbound)
|
|
|
|
git clone --depth 1 --branch 'release-1.14.0' https://github.com/NLnetLabs/unbound.git /tmp/unbound && \
|
|
|
|
cd /tmp/unbound && \
|
|
|
|
./configure && \
|
|
|
|
make && \
|
|
|
|
make install && \
|
|
|
|
# Cleanup build tools
|
2022-01-22 01:23:22 +00:00
|
|
|
make clean && \
|
2022-01-22 01:17:59 +00:00
|
|
|
rm -rf /tmp/* && \
|
|
|
|
apk del alpine-sdk expat-dev git openssl-dev
|
2022-01-21 23:23:55 +00:00
|
|
|
|
|
|
|
# Prepare unbound files
|
|
|
|
COPY entrypoint.sh /
|
|
|
|
RUN mkdir -p /srv/unbound
|
|
|
|
COPY unbound.conf /srv/unbound/unbound.conf
|
|
|
|
|
|
|
|
# Prepare
|
2022-01-22 01:17:59 +00:00
|
|
|
RUN adduser -S unbound --disabled-password
|
2022-01-21 23:23:55 +00:00
|
|
|
|
|
|
|
# Health
|
|
|
|
HEALTHCHECK --interval=60s --timeout=3s --retries=2 \
|
|
|
|
CMD dig ns1.gkcld.net @127.0.0.1 +dnssec || exit 1
|
|
|
|
|
|
|
|
ENTRYPOINT ["sh", "/entrypoint.sh"]
|