-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile_x86_64
61 lines (61 loc) · 2.22 KB
/
Dockerfile_x86_64
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
61
ARG ARCH=frommakefile
ARG DOCKERSRC=frommakefile
ARG USERNAME=frommakefile
#
FROM ${USERNAME}/${DOCKERSRC}:${ARCH}
#
ARG PUID=1000
ARG PGID=1000
#
RUN set -xe \
&& apk add --no-cache --purge -uU curl g++ make linux-headers \
&& VERSION=1.2.9a \
&& echo "Using version: $VERSION" \
&& curl -o /tmp/pdnsd-${VERSION}-par.tar.gz http://members.home.nl/p.a.rombouts/pdnsd/releases/pdnsd-${VERSION}-par.tar.gz \
&& mkdir -p /opt && tar xzf /tmp/pdnsd-${VERSION}-par.tar.gz -C /opt/ \
&& cd /opt/pdnsd-${VERSION} \
&& ./configure --prefix=/usr --sysconfdir=/etc --enable-ipv6 --enable-underscores \
&& make && make install && rm -rf /opt/pdnsd-${VERSION} \
&& mkdir /tmp/hosts \
&& curl -jkSl \
'https://hosts-file.net/download/hosts.zip' > /tmp/hosts/hosts.zip \
&& unzip -p /tmp/hosts/hosts.zip hosts.txt > /tmp/hosts/hosts.file.net.hosts \
&& rm -f /tmp/hosts/hosts.zip \
&& curl -jkSl \
'https://raw.githubusercontent.com/AdAway/adaway.github.io/master/hosts.txt' \
> /tmp/hosts/adaway.hosts \
# && curl -jkSl \
# 'http://www.hostsfile.org/Downloads/hosts.txt' \
# > /tmp/hosts/hostsfile.hosts \
# && curl -jkSl \
# 'http://winhelp2002.mvps.org/hosts.txt' \
# > /tmp/hosts/mvps.hosts \
&& curl -jkSl \
'http://someonewhocares.org/hosts/zero/hosts' \
> /tmp/hosts/someonewhocares.hosts \
&& curl -jkSl \
'https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/fakenews-gambling-porn/hosts' \
> /tmp/hosts/steven.black.hosts \
# && curl -jkSl \
# 'http://pgl.yoyo.org/as/serverlist.php?hostformat=hosts;showintro=0&mimetype=plaintext' \
# > /tmp/hosts/yoyo.hosts \
&& cat /tmp/hosts/*.hosts >> /tmp/hosts.blocked \
&& sed \
-e 's/\r//' \
-e '/^\(127.0.0.1\|0.0.0.0\)/!d' \
-e 's/127.0.0.1/0.0.0.0/' \
-e 's/ \+/\t/' \
-e 's/#.*$//' \
-e 's/[ \t]*$//'\
-e '/localhost$/d' \
< /tmp/hosts.blocked | sort -u > /etc/hosts.blocked \
&& apk del --no-cache --purge g++ make linux-headers unzip \
&& rm -rf /var/cache/apk/* /tmp/*
#
COPY root/ /
#
VOLUME /data/
#
EXPOSE 53/tcp 53/udp
#
ENTRYPOINT ["/init"]