-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile-Dev-V6
152 lines (133 loc) · 3.29 KB
/
Dockerfile-Dev-V6
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
# Define an ARG for the base image tag
ARG BASE_IMG_TAG=none
FROM pihole/pihole:${BASE_IMG_TAG} as openssl
WORKDIR /tmp/src
RUN set -xe; \
apk --update --no-cache add \
ca-certificates \
gnupg \
curl \
file && \
apk --update --no-cache add --virtual .build-deps \
build-base \
perl \
libidn2-dev \
libevent-dev \
linux-headers \
apk-tools && \
git clone https://github.com/openssl/openssl.git && \
cd openssl && \
./config \
--prefix=/opt/openssl \
--openssldir=/opt/openssl \
no-weak-ssl-ciphers \
no-ssl3 \
no-shared \
-DOPENSSL_NO_HEARTBEATS \
-fstack-protector-strong && \
make depend && \
nproc | xargs -I % make -j% && \
make install_sw && \
apk del --no-cache .build-deps && \
rm -rf \
/usr/share/man \
/usr/share/docs \
/opt/openssl/bin \
/tmp/* \
/var/tmp/* \
/var/log/*
FROM pihole/pihole:${BASE_IMG_TAG} as unbound
ENV NAME=unbound \
UNBOUND_VERSION=latest \
UNBOUND_DOWNLOAD_URL=https://nlnetlabs.nl/downloads/unbound/unbound-latest.tar.gz
WORKDIR /tmp/src
COPY --from=openssl /opt/openssl /opt/openssl
RUN set -xe; \
apk --update --no-cache add \
ca-certificates \
gnupg \
curl \
file \
binutils && \
apk --update --no-cache add --virtual .build-deps \
build-base\
libsodium-dev \
linux-headers \
nghttp2-dev \
ngtcp2-dev \
libevent-dev \
expat-dev \
protobuf-c-dev \
hiredis-dev \
apk-tools && \
curl -sSL $UNBOUND_DOWNLOAD_URL -o unbound.tar.gz && \
tar xzf unbound.tar.gz && \
rm -f unbound.tar.gz && \
mv unbound-* unbound && \
cd unbound && \
addgroup -S -g 1000 _unbound && \
adduser -S -H -h /etc -g _unbound -u 1000 -D -G _unbound _unbound && \
./configure \
--disable-dependency-tracking \
--prefix=/opt/unbound \
--with-pthreads \
--with-username=_unbound \
--with-ssl=/opt/openssl \
--with-libevent \
--with-libnghttp2 \
--enable-dnstap \
--enable-tfo-server \
--enable-tfo-client \
--enable-event-api \
--enable-subnet && \
make install && \
mv /opt/unbound/etc/unbound/unbound.conf /opt/unbound/etc/unbound/unbound.conf.example && \
apk del --no-cache .build-deps && \
rm -rf \
/usr/share/man \
/usr/share/docs \
/opt/unbound/share/man \
/tmp/* \
/var/tmp/* \
/var/log/*
FROM pihole/pihole:${BASE_IMG_TAG}
WORKDIR /tmp/src
COPY --from=unbound /opt /opt
RUN set -xe; \
apk --update --no-cache add \
ca-certificates \
tzdata \
drill \
tini \
shadow \
su-exec \
libsodium \
nghttp2 \
ngtcp2 \
libevent \
protobuf-c \
hiredis \
expat \
perl && \
addgroup -S -g 1000 _unbound && \
adduser -S -H -h /etc -g _unbound -u 1000 -D -G _unbound _unbound && \
rm -rf \
/usr/share/man \
/usr/share/docs \
/opt/unbound/share/man \
/tmp/* \
/var/tmp/* \
/var/log/*
WORKDIR /opt/unbound/
# copy extra files
COPY lighttpd-external.conf /etc/lighttpd/external.conf
COPY 99-edns.conf /etc/dnsmasq.d/99-edns.conf
COPY data/ /
RUN chmod +x /unbound.sh
# set version label
LABEL maintainer="OrigamiOfficial"
# environment settings
ENV FTLCONF_dns_upstreams 127.0.0.1#5335
ENV PATH /opt/unbound/sbin:"$PATH"
# target run
CMD ["/unbound.sh"]