dracoox commited on
Commit
0d5ab9d
·
verified ·
1 Parent(s): ca42455

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +16 -4
Dockerfile CHANGED
@@ -24,11 +24,23 @@ RUN mkdir -p /root/.ssh && \
24
  ssh-keygen -t rsa -f /root/.ssh/id_rsa -N '' && \
25
  chmod 700 /root/.ssh && chmod 600 /root/.ssh/id_rsa
26
 
27
- RUN git clone https://github.com/foxytouxxx/freeroot.git /opt/freeroot && \
28
- chmod +x /opt/freeroot/root.sh
 
 
 
 
 
 
 
 
 
 
 
29
 
30
  RUN mkdir -p /app && echo "Tmate Session Running..." > /app/index.html
 
31
  WORKDIR /app
32
 
33
- # Start HTTP server on $PORT and tmate in foreground, redirecting tmate logs to reduce noise
34
- CMD python3 -m http.server $PORT & tmate -F
 
24
  ssh-keygen -t rsa -f /root/.ssh/id_rsa -N '' && \
25
  chmod 700 /root/.ssh && chmod 600 /root/.ssh/id_rsa
26
 
27
+ RUN git clone https://github.com/foxytouxxx/freeroot.git /opt/freeroot
28
+
29
+ # Check if proot binary exists, if not, download official latest release
30
+ RUN if [ ! -f /opt/freeroot/usr/local/bin/proot ]; then \
31
+ mkdir -p /opt/freeroot/usr/local/bin && \
32
+ echo "Downloading proot binary..." && \
33
+ wget --tries=10 --retry-connrefused --timeout=30 -O /opt/freeroot/usr/local/bin/proot https://github.com/proot-me/proot/releases/latest/download/proot-x86_64 && \
34
+ chmod +x /opt/freeroot/usr/local/bin/proot ; \
35
+ else \
36
+ echo "proot already exists"; \
37
+ fi
38
+
39
+ RUN chmod +x /opt/freeroot/root.sh
40
 
41
  RUN mkdir -p /app && echo "Tmate Session Running..." > /app/index.html
42
+
43
  WORKDIR /app
44
 
45
+ # Start HTTP server and tmate simultaneously
46
+ CMD python3 -m http.server $PORT & tmate -F