Dockerfile 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. FROM ubuntu:24.04
  2. # Default directory
  3. WORKDIR /home/user
  4. COPY setup_files/* /home/user/build/
  5. RUN sed -i 's@HOMEDIR@/home/user@g' /home/user/build/config.toml
  6. RUN apt update -y
  7. # git for cloning repos
  8. # cargo for building everything except rdsys
  9. # golang and make for building rdsys
  10. # openssl and libssl-dev as dependencies for (building) the software
  11. #
  12. # psmisc for killing processes after simulation completes
  13. # (killall -s INT rdsys lox-distributor troll-patrol)
  14. # time for collecting performance stats on rdsys
  15. # (other code uses a Rust crate for this)
  16. RUN apt install -y git cargo golang make openssl libssl-dev psmisc time
  17. RUN mkdir -p /home/user/build /home/user/rdsys /home/user/lox-distributor /home/user/troll-patrol /home/user/simulation
  18. # rdsys
  19. # Clone rdsys
  20. WORKDIR /home/user/build
  21. RUN git clone https://gitlab.torproject.org/tpo/anti-censorship/rdsys.git
  22. WORKDIR /home/user/build/rdsys
  23. RUN git checkout 79332a3ee69dc6022a2a29fd8b79e9d2e4f5c9ab
  24. RUN sed -i 's/NUM_BRIDGES = 1000/NUM_BRIDGES = 3600/' scripts/mkdescriptors/main.go
  25. # configure rdsys to give Lox all the bridges
  26. RUN cp /home/user/build/config.json conf/
  27. # Build rdsys and bridge lines
  28. WORKDIR /home/user/build/rdsys
  29. RUN make build && make descriptors
  30. RUN cp -r conf descriptors /home/user/rdsys/
  31. # Copy backend executable as "rdsys"
  32. RUN cp backend /home/user/rdsys/rdsys
  33. # Clone and build things that depend on each other together
  34. # Lox distributor
  35. WORKDIR /home/user/build
  36. RUN git clone https://gitlab.torproject.org/vecna/lox.git
  37. WORKDIR /home/user/build/lox
  38. RUN git checkout 5adf9ee7f070f9909f09ab9342f84376d11dd7dc
  39. RUN mkdir -p .cargo
  40. RUN cp /home/user/build/config.toml .cargo/
  41. # Troll Patrol
  42. WORKDIR /home/user/build
  43. RUN git clone https://git-crysp.uwaterloo.ca/vvecna/troll-patrol.git
  44. WORKDIR /home/user/build/troll-patrol
  45. # Commit on analysis branch
  46. RUN git checkout 7acba0a6f00c6ffdb429b4993ee109a8e125b466
  47. RUN mkdir -p .cargo
  48. RUN cp /home/user/build/config.toml .cargo/
  49. # lox_cli
  50. WORKDIR /home/user/build
  51. RUN git clone https://git-crysp.uwaterloo.ca/vvecna/lox_cli.git
  52. WORKDIR /home/user/build/lox_cli
  53. RUN git checkout d7beaad5601ad309fd5936c19e60a7ea98a05fde
  54. RUN mkdir -p .cargo
  55. RUN cp /home/user/build/config.toml .cargo/
  56. # Build Lox distributor
  57. WORKDIR /home/user/build/lox/crates/lox-distributor
  58. RUN cargo update && cargo build --release --features simulation
  59. RUN cp config.json /home/user/build/lox/target/release/lox-distributor /home/user/lox-distributor/
  60. # Build Troll Patrol
  61. WORKDIR /home/user/build/troll-patrol
  62. RUN cargo update && cargo build --release --features simulation
  63. RUN cp target/release/troll-patrol /home/user/troll-patrol/
  64. # Lox Simulation
  65. WORKDIR /home/user/build/lox-simulation
  66. COPY Cargo.toml /home/user/build/lox-simulation/
  67. RUN mkdir src
  68. COPY src/* /home/user/build/lox-simulation/src/
  69. RUN mkdir -p .cargo
  70. RUN cp /home/user/build/config.toml .cargo/
  71. # Build simulation
  72. WORKDIR /home/user/build/lox-simulation
  73. RUN cargo update && cargo build --release
  74. RUN cp target/release/lox-simulation /home/user/simulation/simulation
  75. WORKDIR /home/user