Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +7 -11
Dockerfile
CHANGED
|
@@ -1,32 +1,28 @@
|
|
| 1 |
-
|
| 2 |
FROM debian:12
|
| 3 |
|
| 4 |
RUN apt update && apt install -y wget curl openssh-server openjdk-17-jre-headless socat gpg
|
| 5 |
|
| 6 |
-
#
|
| 7 |
RUN echo "PermitRootLogin yes" >> /etc/ssh/sshd_config
|
| 8 |
RUN echo "root:eren" | chpasswd
|
| 9 |
|
| 10 |
-
#
|
| 11 |
RUN curl -SsL https://playit-cloud.github.io/ppa/key.gpg | gpg --dearmor | tee /etc/apt/trusted.gpg.d/playit.gpg >/dev/null
|
| 12 |
RUN echo "deb [signed-by=/etc/apt/trusted.gpg.d/playit.gpg] https://playit-cloud.github.io/ppa/data ./" | tee /etc/apt/sources.list.d/playit-cloud.list
|
| 13 |
RUN apt update && apt install -y playit
|
| 14 |
|
| 15 |
-
#
|
| 16 |
RUN mkdir -p /app
|
| 17 |
RUN echo '#!/bin/bash' > /app/start.sh
|
| 18 |
RUN echo 'service ssh start' >> /app/start.sh
|
| 19 |
-
RUN echo 'echo "
|
| 20 |
-
RUN echo '
|
| 21 |
-
RUN echo 'playit agent claim exchange --code YOUR_CLAIM_CODE_HERE' >> /app/start.sh
|
| 22 |
-
RUN echo 'sleep 3' >> /app/start.sh
|
| 23 |
-
RUN echo 'echo "=============================="' >> /app/start.sh
|
| 24 |
-
RUN echo 'echo "Starting agent..."' >> /app/start.sh
|
| 25 |
-
RUN echo 'playit &' >> /app/start.sh
|
| 26 |
RUN echo 'sleep 5' >> /app/start.sh
|
|
|
|
| 27 |
RUN echo 'socat UDP4-LISTEN:2222,fork TCP4:localhost:22 &' >> /app/start.sh
|
| 28 |
RUN echo 'tail -f /dev/null' >> /app/start.sh
|
| 29 |
RUN chmod +x /app/start.sh
|
| 30 |
|
| 31 |
EXPOSE 22 2222
|
|
|
|
| 32 |
CMD ["/app/start.sh"]
|
|
|
|
|
|
|
| 1 |
FROM debian:12
|
| 2 |
|
| 3 |
RUN apt update && apt install -y wget curl openssh-server openjdk-17-jre-headless socat gpg
|
| 4 |
|
| 5 |
+
# 设置 SSH
|
| 6 |
RUN echo "PermitRootLogin yes" >> /etc/ssh/sshd_config
|
| 7 |
RUN echo "root:eren" | chpasswd
|
| 8 |
|
| 9 |
+
# 安装 Playit.gg
|
| 10 |
RUN curl -SsL https://playit-cloud.github.io/ppa/key.gpg | gpg --dearmor | tee /etc/apt/trusted.gpg.d/playit.gpg >/dev/null
|
| 11 |
RUN echo "deb [signed-by=/etc/apt/trusted.gpg.d/playit.gpg] https://playit-cloud.github.io/ppa/data ./" | tee /etc/apt/sources.list.d/playit-cloud.list
|
| 12 |
RUN apt update && apt install -y playit
|
| 13 |
|
| 14 |
+
# 创建启动脚本
|
| 15 |
RUN mkdir -p /app
|
| 16 |
RUN echo '#!/bin/bash' > /app/start.sh
|
| 17 |
RUN echo 'service ssh start' >> /app/start.sh
|
| 18 |
+
RUN echo 'echo "Starting Playit.gg agent with secret key..."' >> /app/start.sh
|
| 19 |
+
RUN echo 'playit --secret $PLAYIT_SECRET &' >> /app/start.sh
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
RUN echo 'sleep 5' >> /app/start.sh
|
| 21 |
+
RUN echo 'echo "Setting up UDP to TCP forwarding for SSH..."' >> /app/start.sh
|
| 22 |
RUN echo 'socat UDP4-LISTEN:2222,fork TCP4:localhost:22 &' >> /app/start.sh
|
| 23 |
RUN echo 'tail -f /dev/null' >> /app/start.sh
|
| 24 |
RUN chmod +x /app/start.sh
|
| 25 |
|
| 26 |
EXPOSE 22 2222
|
| 27 |
+
|
| 28 |
CMD ["/app/start.sh"]
|