-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
executable file
·38 lines (31 loc) · 1.13 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
#
# Dockerfile for chinadns
#
FROM debian:jessie
MAINTAINER kev <noreply@datageek.info>
ENV DNS_VER 1.3.2
ENV DNS_URL https://github.com/clowwindy/ChinaDNS/releases/download/${DNS_VER}/chinadns-${DNS_VER}.tar.gz
ENV DNS_FILE chinadns.tar.gz
ENV DNS_MD5 f3ece30f2a453d25cc22ef6e1ef579b0
RUN apt-get update \
&& apt-get install -y build-essential curl dnsmasq supervisor \
&& mkdir chinadns \
&& cd chinadns \
&& curl -sSL ${DNS_URL} -o ${DNS_FILE} \
&& echo "${DNS_MD5} ${DNS_FILE}" | md5sum -c \
&& tar xzf ${DNS_FILE} --strip 1 \
&& ./configure \
&& make install \
&& cd .. \
&& rm -rf chinadns \
&& apt-get remove -y build-essential \
&& apt-get autoremove -y \
&& rm -rf /var/lib/apt/lists/*
RUN curl http://ftp.apnic.net/apnic/stats/apnic/delegated-apnic-latest \
| grep ipv4 \
| grep CN \
| awk -F\| '{printf("%s/%d\n", $4, 32-log($5)/log(2))}' > /etc/chnroute.txt
ADD ./dnsmasq-update-china-list /usr/bin/
ADD ./services.conf /etc/supervisor/conf.d/
EXPOSE 53/tcp 53/udp
CMD supervisord -n -c /etc/supervisor/supervisord.conf