-
Notifications
You must be signed in to change notification settings - Fork 0
/
tor-ubuntu-20.04
36 lines (30 loc) · 1.37 KB
/
tor-ubuntu-20.04
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
FROM ubuntu:20.04
# install packages required for compilation and testing
RUN sed -i '/deb-src/s/^# //' /etc/apt/sources.list \
&& DEBIAN_FRONTEND=noninteractive apt-get -y update \
&& DEBIAN_FRONTEND=noninteractive apt-get -y install \
build-essential gawk bison python3 automake libseccomp-dev git wget \
strace netcat procps nano less \
&& DEBIAN_FRONTEND=noninteractive apt-get -y build-dep tor \
&& DEBIAN_FRONTEND=noninteractive apt-get -y clean \
&& rm -rf -- /var/lib/apt/lists/*
# install all supported glibc versions
COPY common/install_glibc.sh /root/install_glibc.sh
COPY common/run_with_glibc /usr/local/bin/run_with_glibc
RUN chmod +x /root/install_glibc.sh \
&& chmod +x /usr/local/bin/run_with_glibc
RUN /root/install_glibc.sh 2.29 2.30 2.31
RUN useradd -ms /bin/bash user
USER user
WORKDIR /home/user
# create test directory structure
COPY --chown=user common/make_test_torrcd.sh /home/user/make_test_torrcd.sh
RUN chmod +x /home/user/make_test_torrcd.sh \
&& /home/user/make_test_torrcd.sh /home/user
# build tor - systemd support is disabled so we can run tor with gblic versions lower than the system glibc
RUN git clone https://git.torproject.org/tor.git \
&& cd tor \
&& ./autogen.sh \
&& ./configure --disable-systemd \
&& make -j5
CMD ["su", "-", "user", "-c", "/bin/bash"]