-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
60 lines (49 loc) · 1.61 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
# Use a base image with Python 3 and necessary build tools
FROM debian:bookworm
ARG DEBIAN_FRONTEND=noninteractive
ARG ANON_ENV=live
WORKDIR /home/onionperf
# Install system dependencies
RUN apt-get update && apt-get install -y \
automake \
build-essential \
cmake \
git \
libglib2.0-dev \
libevent-dev \
libigraph-dev \
libssl-dev \
zlib1g-dev \
python3-dev \
python3-venv \
software-properties-common \
&& rm -rf /var/lib/apt/lists/*
RUN apt-get -y update \
&& echo "anon anon/terms boolean true" | debconf-set-selections \
&& apt-get -y install wget apt-transport-https \
&& . /etc/os-release \
&& wget -qO- https://deb.en.anyone.tech/anon.asc | tee /etc/apt/trusted.gpg.d/anon.asc \
&& echo "deb [signed-by=/etc/apt/trusted.gpg.d/anon.asc] https://deb.en.anyone.tech anon-$ANON_ENV-$VERSION_CODENAME main" > /etc/apt/sources.list.d/anon.list \
&& apt-get -y update \
&& apt-get -y install anon
# Clone and build TGen
RUN git clone https://github.com/shadow/tgen.git \
&& cd tgen \
&& mkdir build \
&& cd build \
&& cmake .. \
&& make
# Create and activate a Python virtual environment
RUN python3 -m venv /home/onionperf/venv
ENV PATH="/home/onionperf/venv/bin:$PATH"
# Copy and install OnionPerf
COPY . onionperf
RUN cd onionperf \
&& pip install --no-cache-dir -r requirements.txt \
&& python setup.py install \
&& mv docker-entrypoint.sh .. \
&& cd .. && rm -rf onionperf
# Expose Listen and Connect Ports
EXPOSE 9510 9520
# Start OnionPerf when the container runs
ENTRYPOINT [ "sh", "docker-entrypoint.sh" ]