Download Dockerfile from HuggingFace0920/RustDesk-API2: direct link, hf CLI and curl.
- Browser
- Download file 1.68 kB
-
https://huggingface.co/spaces/HuggingFace0920/RustDesk-API2/resolve/108a3e8d1183f31cba47d55fd690e2e9bfeab014/Dockerfile
- Command line
-
hf download hf://spaces/HuggingFace0920/RustDesk-API2@108a3e8d1183f31cba47d55fd690e2e9bfeab014/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/HuggingFace0920/RustDesk-API2/resolve/108a3e8d1183f31cba47d55fd690e2e9bfeab014/Dockerfile
1.68 kB
| # 使用官方Ubuntu基础镜像 | |
| FROM ubuntu:22.04 | |
| # 设置环境变量 | |
| ENV APP_HOME /app | |
| ENV DEBIAN_FRONTEND noninteractive | |
| # 安装必要的依赖 | |
| RUN apt-get update && \ | |
| apt-get install -y --no-install-recommends \ | |
| curl \ | |
| jq \ | |
| tar \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # 创建应用目录 | |
| RUN mkdir -p $APP_HOME | |
| WORKDIR $APP_HOME | |
| # 下载并解压rustdesk-api的最新版本 | |
| RUN set -eux; \ | |
| # 获取API响应并保存到临时文件,方便调试 | |
| curl -s https://api.github.com/repos/lejianwen/rustdesk-api/releases/latest > latest_release.json; \ | |
| # 显示API响应中的所有资产名称,帮助调试 | |
| echo "Available assets:"; \ | |
| jq -r '.assets[].name' latest_release.json; \ | |
| # 尝试多种匹配方式,确保能找到正确的资产 | |
| URL=$(jq -r '.assets[] | select(.name | test("(?i)linux-amd64.tar.gz")) | .browser_download_url' latest_release.json || \ | |
| jq -r '.assets[] | select(.name | contains("linux") and contains("amd64") and contains("tar.gz")) | .browser_download_url' latest_release.json || \ | |
| jq -r '.assets[0].browser_download_url' latest_release.json); \ | |
| echo "Downloading from: $URL"; \ | |
| [ -n "$URL" ] || { echo "Error: Failed to find download URL"; exit 1; }; \ | |
| curl -L -o linux-amd64.tar.gz "$URL"; \ | |
| tar -xzf linux-amd64.tar.gz; \ | |
| rm linux-amd64.tar.gz; \ | |
| # 验证文件是否成功下载 | |
| ls -la; \ | |
| [ -f rustdesk-api ] || { echo "Error: rustdesk-api binary not found"; exit 1; } | |
| # 暴露应用端口(根据实际应用调整) | |
| EXPOSE 8080 | |
| # 设置容器启动命令(根据实际应用调整) | |
| CMD ["./rustdesk-api", "--config", "config.toml"] | |