Dockerfile 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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. RUN git checkout 7acba0a6f00c6ffdb429b4993ee109a8e125b466
  46. RUN mkdir -p .cargo
  47. RUN cp /home/user/build/config.toml .cargo/
  48. # lox_cli
  49. WORKDIR /home/user/build
  50. RUN git clone https://git-crysp.uwaterloo.ca/vvecna/lox_cli.git
  51. WORKDIR /home/user/build/lox_cli
  52. RUN git checkout d7beaad5601ad309fd5936c19e60a7ea98a05fde
  53. RUN mkdir -p .cargo
  54. RUN cp /home/user/build/config.toml .cargo/
  55. # Build Lox distributor
  56. WORKDIR /home/user/build/lox/crates/lox-distributor
  57. RUN cargo update && cargo build --release --features simulation
  58. RUN cp config.json /home/user/build/lox/target/release/lox-distributor /home/user/lox-distributor/
  59. # Build Troll Patrol
  60. WORKDIR /home/user/build/troll-patrol
  61. RUN cargo update && cargo build --release --features simulation
  62. RUN cp target/release/troll-patrol /home/user/troll-patrol/
  63. # Lox Simulation
  64. WORKDIR /home/user/build/lox-simulation
  65. COPY Cargo.toml /home/user/build/lox-simulation/
  66. RUN mkdir src
  67. COPY src/* /home/user/build/lox-simulation/src/
  68. RUN mkdir -p .cargo
  69. RUN cp /home/user/build/config.toml .cargo/
  70. # Build simulation
  71. WORKDIR /home/user/build/lox-simulation
  72. RUN cargo update && cargo build --release
  73. RUN cp target/release/lox-simulation /home/user/simulation/simulation
  74. WORKDIR /home/user