1
2
mirror of https://github.com/vimagick/dockerfiles synced 2024-06-25 00:08:49 +00:00

add chinadns

This commit is contained in:
kev 2015-03-06 00:16:47 +08:00
parent 201e117ae3
commit 025787d034
4 changed files with 44 additions and 0 deletions

32
chinadns/Dockerfile Normal file

@ -0,0 +1,32 @@
#
# Dockerfile for chinadns
#
FROM ubuntu:14.04
MAINTAINER kev <noreply@datageek.info>
RUN apt-get update
RUN apt-get install -y build-essential supervisor dnsmasq
RUN apt-get clean
ADD ./services.conf /etc/supervisor/conf.d/
ADD ./dnsmasq.conf /etc/
ADD https://github.com/clowwindy/ChinaDNS/releases/download/1.3.0/chinadns-1.3.0.tar.gz /tmp/pkgs/
ADD http://ftp.apnic.net/apnic/stats/apnic/delegated-apnic-latest /tmp/pkgs/
WORKDIR /tmp/pkgs/
RUN tar xzf chinadns-1.3.0.tar.gz && \
cd chinadns-1.3.0 && \
./configure && \
make && \
make install
RUN cat delegated-apnic-latest | grep ipv4 | grep CN | \
awk -F\| '{ printf("%s/%d\n", $4, 32-log($5)/log(2)) }' > /etc/chnroute.txt
WORKDIR /
RUN rm -r /tmp/pkgs/
EXPOSE 53 53/udp
CMD supervisord -n -c /etc/supervisor/supervisord.conf

5
chinadns/fig.yml Normal file

@ -0,0 +1,5 @@
dnscrypt:
image: vimagick/dnscrypt
ports:
- "53:53/udp"
- "53:53/tcp"

7
chinadns/services.conf Normal file

@ -0,0 +1,7 @@
[program:chinadns]
priority = 100
command = chinadns -m -c /etc/chnroute.txt -p 2053
[program:dnsmasq]
priority = 200
command = dnsmasq -C /etc/dnsmasq.conf