unbound/Dockerfile

48 lines
965 B
Docker
Raw Normal View History

2021-10-26 14:00:24 +02:00
FROM alpine:3.13 AS builder
2021-10-28 11:38:59 +02:00
ARG UNBOUND_TAG="this_invalid_tag_certainly_does_not_exist"
ARG UNBOUND_CLONE_URL="https://github.com/NLnetLabs/unbound.git"
2021-10-26 14:00:24 +02:00
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-28 11:38:59 +02:00
git clone --branch ${UNBOUND_TAG} ${UNBOUND_CLONE_URL} && \
2021-10-26 14:13:45 +02:00
cd unbound && \
2021-10-27 13:36:34 +02:00
./configure --with-libnghttp2 --with-libevent --prefix /opt/unbound --sysconfdir /etc && \
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-27 13:36:34 +02:00
adduser -D unbound
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:36:34 +02:00
CMD [ "/opt/unbound/sbin/unbound" ]
2021-09-28 12:11:58 +02:00