diff --git a/chinadns/Dockerfile b/chinadns/Dockerfile new file mode 100644 index 0000000..5c1fd48 --- /dev/null +++ b/chinadns/Dockerfile @@ -0,0 +1,32 @@ +# +# Dockerfile for chinadns +# + +FROM ubuntu:14.04 +MAINTAINER kev + +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 diff --git a/dnscrypt/dnsmasq.conf b/chinadns/dnsmasq.conf similarity index 100% rename from dnscrypt/dnsmasq.conf rename to chinadns/dnsmasq.conf diff --git a/chinadns/fig.yml b/chinadns/fig.yml new file mode 100644 index 0000000..6c64a6a --- /dev/null +++ b/chinadns/fig.yml @@ -0,0 +1,5 @@ +dnscrypt: + image: vimagick/dnscrypt + ports: + - "53:53/udp" + - "53:53/tcp" diff --git a/chinadns/services.conf b/chinadns/services.conf new file mode 100644 index 0000000..bea8369 --- /dev/null +++ b/chinadns/services.conf @@ -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