Download Dockerfile from laalucas/gotty: direct link, hf CLI and curl.
- Browser
- Download file 1.1 kB
-
https://huggingface.co/spaces/laalucas/gotty/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/laalucas/gotty/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/laalucas/gotty/resolve/main/Dockerfile
1.1 kB
| FROM ubuntu:22.04 | |
| ENV DEBIAN_FRONTEND=noninteractive | |
| # 安装依赖 | |
| RUN apt-get update && \ | |
| apt-get install -y bash curl tar file && \ | |
| rm -rf /var/lib/apt/lists/* | |
| # 创建普通用户 sealos,确保 /etc/passwd 有条目,解决 "I have no name!" | |
| RUN useradd -m -s /bin/bash sealos && \ | |
| echo "sealos:x:1000:1000:sealos:/home/sealos:/bin/bash" >> /etc/passwd | |
| # 切换到 /usr/local/bin | |
| WORKDIR /usr/local/bin | |
| # 下载 gotty、解压、设置权限,并验证可执行性 | |
| RUN curl -L https://github.com/yudai/gotty/releases/download/v1.0.1/gotty_linux_amd64.tar.gz \ | |
| -o /tmp/gotty.tar.gz && \ | |
| tar -xzvf /tmp/gotty.tar.gz -C /usr/local/bin && \ | |
| chmod +x /usr/local/bin/gotty && \ | |
| rm /tmp/gotty.tar.gz && \ | |
| /usr/local/bin/gotty --version | |
| # 工作目录 | |
| WORKDIR /app | |
| COPY index.html /app/index.html | |
| # 启动脚本 | |
| COPY start.sh /usr/local/bin/start.sh | |
| RUN chmod +x /usr/local/bin/start.sh | |
| # 暴露 HF Space 默认端口 | |
| EXPOSE 7860 | |
| # 使用普通用户运行 gotty,绑定 HF 自动注入的 $PORT | |
| USER sealos | |
| # 启动脚本 | |
| CMD ["/usr/local/bin/start.sh"] |