forked from obi12341/docker-unbound
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
60 lines (52 loc) · 1.4 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
FROM ubuntu:trusty
MAINTAINER [email protected]
ENV VERSION 1.6.7
WORKDIR /usr/local/src/
ADD assets/sha256checksum sha256checksum
RUN apt-get update && apt-get install -y \
build-essential \
tar \
wget \
libssl-dev \
libevent-dev \
libevent-2.0-5 \
libexpat1-dev \
dnsutils \
&& wget http://www.unbound.net/downloads/unbound-${VERSION}.tar.gz -P /usr/local/src/ \
&& sha256sum -c sha256checksum \
&& tar -xvf unbound-${VERSION}.tar.gz \
&& rm unbound-${VERSION}.tar.gz \
&& cd unbound-${VERSION} \
&& ./configure --prefix=/usr/local --with-libevent \
&& make \
&& make install \
&& cd ../ \
&& rm -R unbound-${VERSION} \
&& apt-get purge -y \
build-essential \
gcc \
gcc-4.8 \
cpp \
cpp-4.8 \
libssl-dev \
libevent-dev \
libexpat1-dev \
&& apt-get autoremove --purge -y \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN useradd --system unbound --home /home/unbound --create-home
ENV PATH $PATH:/usr/local/lib
RUN ldconfig
ADD assets/unbound.conf /usr/local/etc/unbound/unbound.conf
RUN mkdir /usr/local/etc/unbound/conf.d
RUN chown -R unbound:unbound /usr/local/etc/unbound/
USER unbound
RUN unbound-anchor -a /usr/local/etc/unbound/root.key ; true
RUN unbound-control-setup \
&& wget ftp://FTP.INTERNIC.NET/domain/named.cache -O /usr/local/etc/unbound/root.hints
USER root
ADD start.sh /start.sh
RUN chmod +x /start.sh
EXPOSE 53/udp
EXPOSE 53
CMD ["/start.sh"]