-
-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathDockerfile
153 lines (137 loc) · 4.67 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
FROM ubuntu:focal
LABEL org.opencontainers.image.title="darc" \
org.opencontainers.image.description="Darkweb Crawler Project" \
org.opencontainers.image.url="https://darc.jarryshaw.me/" \
org.opencontainers.image.source="https://github.com/JarryShaw/darc" \
org.opencontainers.image.version="1.0.3" \
org.opencontainers.image.licenses='BSD 3-Clause "New" or "Revised" License'
STOPSIGNAL SIGINT
HEALTHCHECK --interval=1h --timeout=1m \
CMD wget https://httpbin.org/get -O /dev/null || exit 1
ARG DARC_USER="darc"
ENV LANG="C.UTF-8" \
LC_ALL="C.UTF-8" \
PYTHONIOENCODING="UTF-8" \
DEBIAN_FRONTEND="teletype" \
DARC_USER="${DARC_USER}"
# DEBIAN_FRONTEND="noninteractive"
COPY extra/retry.sh /usr/local/bin/retry
COPY extra/install.py /usr/local/bin/pty-install
#COPY extra/rename-jdk.sh /usr/local/bin/rename-jdk
COPY vendor/jdk-11.0.18_linux-x64_bin.tar.gz /var/cache/oracle-jdk11-installer-local/
RUN set -x \
&& retry apt-get update \
&& retry apt-get install --yes --no-install-recommends \
apt-utils \
&& retry apt-get install --yes --no-install-recommends \
gcc \
g++ \
libmagic1 \
make \
software-properties-common \
tar \
unzip \
zlib1g-dev \
&& retry add-apt-repository ppa:deadsnakes/ppa --yes \
&& retry add-apt-repository ppa:linuxuprising/java --yes \
&& retry add-apt-repository ppa:i2p-maintainers/i2p --yes
RUN retry apt-get update \
&& retry apt-get install --yes --no-install-recommends \
python3.9-dev \
python3-pip \
python3-setuptools \
python3-wheel \
&& ln -sf /usr/bin/python3.9 /usr/local/bin/python3
RUN retry pty-install --stdin '6\n70' apt-get install --yes --no-install-recommends \
tzdata \
#&& retry rename-jdk \
&& retry pty-install --stdin 'yes' apt-get install --yes \
oracle-java11-installer-local
RUN retry apt-get install --yes --no-install-recommends \
sudo \
&& adduser --disabled-password --gecos '' ${DARC_USER} \
&& adduser ${DARC_USER} sudo \
&& echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
## Tor
RUN retry apt-get install --yes --no-install-recommends tor
COPY extra/torrc.focal /etc/tor/torrc
## I2P
RUN retry apt-get install --yes --no-install-recommends i2p
COPY extra/i2p.focal /etc/defaults/i2p
## ZeroNet
COPY vendor/ZeroNet-linux-dist-linux64.tar.gz /tmp
RUN set -x \
&& cd /tmp \
&& tar xvpfz ZeroNet-linux-dist-linux64.tar.gz \
&& mv ZeroNet-linux-dist-linux64 /usr/local/src/zeronet
COPY extra/zeronet.focal.conf /usr/local/src/zeronet/zeronet.conf
## FreeNet
USER darc
COPY vendor/new_installer_offline.jar /tmp
RUN set -x \
&& cd /tmp \
&& ( pty-install --stdin '/home/darc/freenet\n1' java -jar new_installer_offline.jar || true ) \
&& sudo mv /home/darc/freenet /usr/local/src/freenet
USER root
## NoIP
COPY vendor/noip-duc-linux.tar.gz /tmp
RUN set -x \
&& cd /tmp \
&& tar xvpfz noip-duc-linux.tar.gz \
&& mv noip-2.1.9-1 /usr/local/src/noip \
&& cd /usr/local/src/noip \
&& make
# && make install
# # set up timezone
# RUN echo 'Asia/Shanghai' > /etc/timezone \
# && rm -f /etc/localtime \
# && ln -snf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
# && dpkg-reconfigure -f noninteractive tzdata
COPY vendor/chromedriver_linux64.zip \
vendor/google-chrome-stable_current_amd64.deb /tmp/
RUN set -x \
## ChromeDriver
&& unzip -d /usr/bin /tmp/chromedriver_linux64.zip \
&& which chromedriver \
## Google Chrome
&& ( dpkg --install /tmp/google-chrome-stable_current_amd64.deb || true ) \
&& retry apt-get install --fix-broken --yes --no-install-recommends \
&& dpkg --install /tmp/google-chrome-stable_current_amd64.deb \
&& which google-chrome
# Using pip:
COPY requirements.txt /tmp
RUN python3 -m pip install -r /tmp/requirements.txt --no-cache-dir
RUN set -x \
&& rm -rf \
## APT repository lists
/var/lib/apt/lists/* \
## Python dependencies
/tmp/requirements.txt \
/tmp/pip \
## ChromeDriver
/tmp/chromedriver_linux64.zip \
## Google Chrome
/tmp/google-chrome-stable_current_amd64.deb \
## Vendors
/tmp/new_installer_offline.jar \
/tmp/noip-duc-linux.tar.gz \
/tmp/ZeroNet-linux-dist-linux64.tar.gz \
#&& apt-get remove --auto-remove --yes \
# software-properties-common \
# unzip \
&& apt-get autoremove -y \
&& apt-get autoclean \
&& apt-get clean
ENTRYPOINT [ "python3", "-m", "darc" ]
#ENTRYPOINT [ "bash", "/app/run.sh" ]
CMD [ "--help" ]
WORKDIR /app
COPY darc/ /app/darc/
COPY LICENSE \
MANIFEST.in \
README.rst \
extra/run.sh \
setup.cfg \
setup.py \
test_darc.py /app/
RUN python3 -m pip install -e .