-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathDockerfile
72 lines (60 loc) · 2.05 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
ARG FRM='pihole/pihole'
ARG TAG='latest'
FROM debian:bullseye as unbound
ARG UNBOUND_VERSION=1.22.0
ARG UNBOUND_SHA256=c5dd1bdef5d5685b2cedb749158dd152c52d44f65529a34ac15cd88d4b1b3d43
ARG UNBOUND_DOWNLOAD_URL=https://nlnetlabs.nl/downloads/unbound/unbound-1.22.0.tar.gz
WORKDIR /tmp/src
RUN build_deps="curl gcc libc-dev libevent-dev libexpat1-dev libnghttp2-dev make libssl-dev" && \
set -x && \
DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -y --no-install-recommends \
$build_deps \
bsdmainutils \
ca-certificates \
ldnsutils \
libevent-2.1-7 \
libexpat1 \
libprotobuf-c-dev \
protobuf-c-compiler && \
curl -sSL $UNBOUND_DOWNLOAD_URL -o unbound.tar.gz && \
echo "${UNBOUND_SHA256} *unbound.tar.gz" | sha256sum -c - && \
tar xzf unbound.tar.gz && \
rm -f unbound.tar.gz && \
cd unbound-${UNBOUND_VERSION} && \
groupadd unbound && \
useradd -g unbound -s /dev/null -d /etc unbound && \
./configure \
--disable-dependency-tracking \
--with-pthreads \
--with-username=unbound \
--with-libevent \
--with-libnghttp2 \
--enable-dnstap \
--enable-tfo-server \
--enable-tfo-client \
--enable-event-api \
--enable-subnet && \
make -j$(nproc) install && \
apt-get purge -y --auto-remove \
$build_deps && \
rm -rf \
/tmp/* \
/var/tmp/* \
/var/lib/apt/lists/*
FROM ${FRM}:${TAG}
ARG FRM
ARG TAG
ARG TARGETPLATFORM
RUN mkdir -p /usr/local/etc/unbound
COPY --from=unbound /usr/local/sbin/unbound* /usr/local/sbin/
COPY --from=unbound /usr/local/lib/libunbound* /usr/local/lib/
COPY --from=unbound /usr/local/etc/unbound/* /usr/local/etc/unbound/
RUN apt update && \
apt install -y bash nano curl wget stubby libssl-dev
ADD scripts /temp
RUN groupadd unbound \
&& useradd -g unbound unbound \
&& /bin/bash /temp/install.sh \
&& rm -rf /temp/install.sh
VOLUME ["/config"]
RUN echo "$(date "+%d.%m.%Y %T") Built from ${FRM} with tag ${TAG}" >> /build_date.info