Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: 添加Dockerfile - 这么好的项目怎么能没有Docker一键运行的指南呢 #951

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# 使用 .NET SDK 作为基础镜像
FROM mcr.microsoft.com/dotnet/sdk:8.0

# 设置工作目录
WORKDIR /app

# 安装 BBDown
RUN dotnet tool install --global BBDown

# 安装 ffmpeg
RUN apt-get update && apt-get install -y ffmpeg && rm -rf /var/lib/apt/lists/*

# 将 dotnet tools 添加到 PATH
ENV PATH="${PATH}:/root/.dotnet/tools"

# 创建下载目录
RUN mkdir -p /downloads
WORKDIR /downloads

# 设置容器启动时的默认命令
ENTRYPOINT ["BBDown"]

# 说明书:
# docker build -t bbdown .
# docker run --rm -v $(pwd)/downloads:/downloads bbdown BV1LSSHYXEtv --use-app-api --work-dir /downloads
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,19 @@ dotnet tool install --global BBDown
dotnet tool update --global BBDown
```

<details>
<summary>New: 使用Docker一键下载视频 (NEW)</summary>

```
# 第一步打包镜像
docker build -t bbdown .
# 第二步下载视频 (例如BV1LSSHYXEtv)
docker run --rm -v $(pwd)/downloads:/downloads bbdown BV1LSSHYXEtv --use-app-api --work-dir /downloads
```

</details>


# 下载
Release版本:https://github.com/nilaoda/BBDown/releases

Expand Down