Dockerfile 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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. RUN apt install -y git cargo golang make openssl libssl-dev
  8. RUN mkdir -p /home/user/build /home/user/rdsys /home/user/lox-distributor /home/user/troll-patrol /home/user/simulation
  9. # Clone all our projects
  10. # rdsys
  11. WORKDIR /home/user/build
  12. RUN git clone https://gitlab.torproject.org/tpo/anti-censorship/rdsys.git
  13. WORKDIR /home/user/build/rdsys
  14. RUN git checkout 79332a3ee69dc6022a2a29fd8b79e9d2e4f5c9ab
  15. RUN sed -i 's/NUM_BRIDGES = 1000/NUM_BRIDGES = 3600/' scripts/mkdescriptors/main.go
  16. # configure rdsys to give Lox all the bridges
  17. RUN cp /home/user/build/config.json conf/
  18. # Lox distributor
  19. WORKDIR /home/user/build
  20. RUN git clone https://gitlab.torproject.org/vecna/lox.git
  21. WORKDIR /home/user/build/lox
  22. RUN git checkout 7b524e771ec444e07fff5b679c8c9e9b557829a0
  23. RUN mkdir -p .cargo
  24. RUN cp /home/user/build/config.toml .cargo/
  25. # lox_cli
  26. WORKDIR /home/user/build
  27. RUN git clone https://git-crysp.uwaterloo.ca/vvecna/lox_cli.git
  28. WORKDIR /home/user/build/lox_cli
  29. RUN git checkout d7beaad5601ad309fd5936c19e60a7ea98a05fde
  30. RUN mkdir -p .cargo
  31. RUN cp /home/user/build/config.toml .cargo/
  32. # Troll Patrol
  33. WORKDIR /home/user/build
  34. RUN git clone https://git-crysp.uwaterloo.ca/vvecna/troll-patrol.git
  35. WORKDIR /home/user/build/troll-patrol
  36. RUN git checkout dc7531689c2a5ec5b4c757f95a87f576c4d4020c
  37. RUN mkdir -p .cargo
  38. RUN cp /home/user/build/config.toml .cargo/
  39. # Lox Simulation
  40. WORKDIR /home/user/build/lox-simulation
  41. COPY Cargo.toml /home/user/build/lox-simulation/
  42. RUN mkdir src
  43. COPY src/* /home/user/build/lox-simulation/src/
  44. RUN mkdir -p .cargo
  45. RUN cp /home/user/build/config.toml .cargo/
  46. # Build all the software
  47. # Build rdsys and bridge lines
  48. WORKDIR /home/user/build/rdsys
  49. RUN make build && make descriptors
  50. RUN cp -r backend conf descriptors /home/user/rdsys/
  51. # Build Lox distributor
  52. WORKDIR /home/user/build/lox/crates/lox-distributor
  53. RUN cargo update && cargo build --release
  54. RUN cp config.json /home/user/build/lox/target/release/lox-distributor /home/user/lox-distributor/
  55. # Build Troll Patrol
  56. WORKDIR /home/user/build/troll-patrol
  57. RUN cargo update && cargo build --release --features simulation
  58. RUN cp target/release/troll-patrol /home/user/troll-patrol/
  59. # Build simulation
  60. WORKDIR /home/user/build/lox-simulation
  61. RUN cargo update && cargo build --release
  62. RUN cp target/release/lox-simulation /home/user/simulation/simulation
  63. WORKDIR /home/user