Download Dockerfile from Cwhd2/grok2: direct link, hf CLI and curl.
- Browser
- Download file 1.33 kB
-
https://huggingface.co/spaces/Cwhd2/grok2/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/Cwhd2/grok2/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/Cwhd2/grok2/resolve/main/Dockerfile
1.33 kB
| FROM ghcr.io/jiujiu532/grok2api:latest | |
| # 切换到 root 用户以安装依赖 | |
| USER root | |
| # Alpine Linux 使用 apk 替代 apt-get,并额外安装 bash | |
| RUN apk add --no-cache curl ca-certificates grep bash | |
| # 显式设置工作目录 | |
| WORKDIR /app | |
| # 自动获取并安装最新版 wgcf (Cloudflare WARP 账号生成器) | |
| RUN DOWNLOAD_URL=$(curl -fsSL https://api.github.com/repos/ViRb3/wgcf/releases/latest | grep 'browser_download_url' | cut -d'"' -f4 | grep "linux_amd64") && \ | |
| curl -Lo /usr/local/bin/wgcf "$DOWNLOAD_URL" && \ | |
| chmod +x /usr/local/bin/wgcf | |
| # 自动获取并安装最新版 wireproxy (用户态 WireGuard 客户端) | |
| RUN DOWNLOAD_URL=$(curl -fsSL https://api.github.com/repos/octeep/wireproxy/releases/latest | grep 'browser_download_url' | cut -d'"' -f4 | grep "linux_amd64.tar.gz") && \ | |
| curl -Lo /tmp/wireproxy.tar.gz "$DOWNLOAD_URL" && \ | |
| tar -xzf /tmp/wireproxy.tar.gz -C /usr/local/bin/ wireproxy && \ | |
| chmod +x /usr/local/bin/wireproxy && \ | |
| rm -f /tmp/wireproxy.tar.gz | |
| # 声明 HF 容器必需的端口 | |
| ENV SERVER_PORT=7860 | |
| EXPOSE 7860 | |
| # 【核心修复】将您上传的配置文件拷贝到容器的工作目录中 | |
| COPY wgcf-profile.conf* /app/ | |
| # 复制启动脚本并赋予执行权限 | |
| COPY entrypoint.sh /entrypoint.sh | |
| RUN chmod +x /entrypoint.sh | |
| ENTRYPOINT ["/entrypoint.sh"] |