1
0
mirror of https://github.com/vimagick/dockerfiles.git synced 2024-12-27 02:09:06 +02:00
dockerfiles/chinadns/Dockerfile

38 lines
1.1 KiB
Docker
Raw Normal View History

2015-03-05 18:16:47 +02:00
#
# Dockerfile for chinadns
#
2015-05-23 07:57:18 +02:00
FROM debian:jessie
2016-05-01 03:06:20 +02:00
MAINTAINER kev <noreply@easypi.info>
2015-03-05 18:16:47 +02:00
2015-08-05 17:12:08 +02:00
ENV DNS_VER 1.3.2
2015-05-23 06:48:11 +02:00
ENV DNS_URL https://github.com/clowwindy/ChinaDNS/releases/download/${DNS_VER}/chinadns-${DNS_VER}.tar.gz
ENV DNS_FILE chinadns.tar.gz
2015-08-05 17:12:08 +02:00
ENV DNS_MD5 f3ece30f2a453d25cc22ef6e1ef579b0
2015-05-23 06:48:11 +02:00
RUN apt-get update \
&& apt-get install -y build-essential curl dnsmasq supervisor \
2015-05-31 06:19:40 +02:00
&& 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 \
2015-05-23 06:48:11 +02:00
&& apt-get remove -y build-essential \
2015-05-23 07:01:24 +02:00
&& apt-get autoremove -y \
2015-05-23 06:48:11 +02:00
&& 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
2015-03-05 18:16:47 +02:00
ADD ./services.conf /etc/supervisor/conf.d/
2015-05-23 06:48:11 +02:00
EXPOSE 53/tcp 53/udp
2015-03-05 18:16:47 +02:00
CMD supervisord -n -c /etc/supervisor/supervisord.conf