unbound/Dockerfile

47 lines
969 B
Docker
Raw Normal View History

2021-10-26 14:00:24 +02:00
FROM alpine:3.13 AS builder
RUN \
apk update && \
apk add alpine-sdk && \
apk add nghttp2-libs && \
apk add nghttp2-dev && \
apk add openssl-dev && \
apk add expat-dev && \
apk add libevent-dev && \
2021-10-26 14:14:46 +02:00
mkdir build && \
cd build && \
2021-10-26 14:13:45 +02:00
git clone https://github.com/NLnetLabs/unbound.git && \
cd unbound && \
2021-10-27 13:11:07 +02:00
./configure --with-libnghttp2 --with-libevent --prefix /opt/unbound && \
2021-10-26 14:00:24 +02:00
make && \
make install
2021-09-28 12:11:58 +02:00
FROM alpine:3.13
2021-10-26 14:00:24 +02:00
COPY --from=builder /opt/unbound/ /opt/unbound
2021-09-28 12:11:58 +02:00
RUN \
2021-10-26 14:00:24 +02:00
apk add --no-cache openssl && \
apk add --no-cache nghttp2-libs && \
apk add --no-cache expat && \
apk add --no-cache libevent && \
2021-10-26 14:29:45 +02:00
adduser -D unbound && \
2021-10-27 13:11:07 +02:00
mkdir /etc/unbound && \
2021-10-27 13:12:34 +02:00
mv /opt/unbound/etc/unbound/unbound.conf /opt/unbound/etc/unbound/unbound.conf-dist
2021-09-28 12:11:58 +02:00
2021-10-27 13:11:07 +02:00
COPY unbound.conf /etc/unbound/unbound.conf
2021-09-28 12:11:58 +02:00
EXPOSE 53/udp
2021-10-26 14:00:24 +02:00
EXPOSE 53/tcp
EXPOSE 853/tcp
2021-09-28 12:11:58 +02:00
2021-10-27 13:11:07 +02:00
VOLUME /etc/unbound
2021-09-28 12:11:58 +02:00
2021-10-27 13:11:07 +02:00
CMD [ "/opt/unbound/sbin/unbound", "-c", "/etc/unbound/unbound.conf" ]
2021-09-28 12:11:58 +02:00