Spaces:
Runtime error
Runtime error
Download Dockerfile from Nowa998/minecraft-server: direct link, hf CLI and curl.
- Browser
- Download file 1.11 kB
-
https://huggingface.co/spaces/Nowa998/minecraft-server/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/Nowa998/minecraft-server/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/Nowa998/minecraft-server/resolve/main/Dockerfile
1.11 kB
| 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"] |