Speed up Docker apt install with configurable mirror.

Add APT_MIRROR build arg to switch Debian source before apt-get update, and document faster build command using BuildKit and host network.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
renjue
2026-05-09 16:32:11 +08:00
parent 7e3f4d792f
commit 3ed3d34900
2 changed files with 11 additions and 0 deletions

View File

@@ -69,6 +69,14 @@ npm run dev
docker build -t media-crawler:latest .
```
构建较慢时可使用加速参数BuildKit + host 网络 + 可选 apt 镜像):
```bash
DOCKER_BUILDKIT=1 docker build --network=host \
--build-arg APT_MIRROR=mirrors.aliyun.com \
-t media-crawler:latest .
```
### 运行容器
```bash