unbound/Dockerfile

31 lines
983 B
Docker
Raw Normal View History

2022-07-21 19:18:43 +00:00
FROM alpine:3.15.5
2022-11-17 22:18:52 +00:00
ARG UNBOUND_VERSION=1.17.0
2022-01-21 23:23:55 +00:00
# Install dependencies and build unbound, clean up after
2022-11-17 22:18:52 +00:00
RUN apk --update add --no-cache alpine-sdk bison dns-root-hints expat-dev flex git openssl-dev && \
2022-07-21 19:18:43 +00:00
# Clone tag and build unbound source (https://github.com/NLnetLabs/unbound)
git clone --depth 1 --branch "release-${UNBOUND_VERSION}" https://github.com/NLnetLabs/unbound.git /tmp/unbound && \
2022-01-22 01:17:59 +00:00
cd /tmp/unbound && \
./configure && \
make && \
make install && \
2022-11-17 22:18:52 +00:00
# Clean up build dependencies
2022-01-22 01:23:22 +00:00
make clean && \
2022-11-17 22:18:52 +00:00
cd /srv && \
2022-01-22 01:17:59 +00:00
rm -rf /tmp/* && \
2022-11-17 22:18:52 +00:00
apk del alpine-sdk bison expat-dev flex git openssl-dev
2022-01-21 23:23:55 +00:00
2022-01-23 21:59:17 +00:00
# Prepare image
2022-11-17 22:30:07 +00:00
COPY entrypoint.sh /srv/
COPY healthcheck.sh /srv/
## Prepare unbound
2022-11-17 22:30:07 +00:00
RUN addgroup -S unbound
RUN adduser -S -G unbound unbound
2022-01-23 21:59:17 +00:00
RUN mkdir -p /srv/unbound/conf
2022-01-21 23:23:55 +00:00
COPY unbound.conf /srv/unbound/unbound.conf
HEALTHCHECK --interval=30s --timeout=2s --retries=1 CMD sh /srv/healthcheck.sh
2022-11-17 22:30:07 +00:00
ENTRYPOINT ["sh", "/srv/entrypoint.sh"]