Spaces:
Runtime error
Runtime error
File size: 1,112 Bytes
74bc08c 6057807 74bc08c 88d2339 74bc08c 88d2339 6057807 edc161f 88d2339 74bc08c 88d2339 6057807 88d2339 f3a928b 6057807 74bc08c f3a928b 88d2339 74bc08c | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | FROM debian:12
RUN apt update && apt install -y wget curl openssh-server openjdk-17-jre-headless socat gpg
# 设置 SSH
RUN echo "PermitRootLogin yes" >> /etc/ssh/sshd_config
RUN echo "root:eren" | chpasswd
# 安装 Playit.gg
RUN curl -SsL https://playit-cloud.github.io/ppa/key.gpg | gpg --dearmor | tee /etc/apt/trusted.gpg.d/playit.gpg >/dev/null
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
RUN apt update && apt install -y playit
# 创建启动脚本
RUN mkdir -p /app
RUN echo '#!/bin/bash' > /app/start.sh
RUN echo 'service ssh start' >> /app/start.sh
RUN echo 'echo "Starting Playit.gg agent with secret key..."' >> /app/start.sh
RUN echo 'playit --secret $PLAYIT_SECRET &' >> /app/start.sh
RUN echo 'sleep 5' >> /app/start.sh
RUN echo 'echo "Setting up UDP to TCP forwarding for SSH..."' >> /app/start.sh
RUN echo 'socat UDP4-LISTEN:2222,fork TCP4:localhost:22 &' >> /app/start.sh
RUN echo 'tail -f /dev/null' >> /app/start.sh
RUN chmod +x /app/start.sh
EXPOSE 22 2222
CMD ["/app/start.sh"] |