Wang Defa 9bf60a2eb8
All checks were successful
Build and Push TFTP Docker Image / docker-build-push (push) Successful in 16s
添加 README.md 文件
2025-12-03 12:16:16 +08:00
2025-12-03 11:32:26 +08:00
2025-12-03 11:32:26 +08:00
2025-12-03 11:32:26 +08:00
2025-12-03 12:16:16 +08:00

TFTP 守护进程

基于 Alpine Linux 的轻量级容器化 TFTP 服务器,专为网络启动和文件服务场景设计。

快速开始

基础使用

使用本地目录挂载运行 TFTP 服务器:

docker run -d \
  -p 69:69/udp \
  -v /path/to/tftpboot:/var/lib/tftpboot \
  gitea.bcde.io/wangdefa/tftpd:latest

启用 NetBoot.xyz

启用 netboot.xyz EFI 启动文件的自动下载:

docker run -d \
  -p 69:69/udp \
  -e DOWNLOAD_NETBOOT_XYZ=true \
  -v /path/to/tftpboot:/var/lib/tftpboot \
  gitea.bcde.io/wangdefa/tftpd:latest

配置

环境变量

变量 说明 默认值
DOWNLOAD_NETBOOT_XYZ 启动时下载 netboot.xyz EFI 文件 false

卷挂载

容器路径 说明
/var/lib/tftpboot TFTP 服务的根目录

端口暴露

端口 协议 说明
69 UDP TFTP 服务端口

使用场景

NetBoot.xyz 启动菜单

使用 netboot.xyz 提供网络启动菜单:

docker run -d \
  --name tftpd-netboot \
  -p 69:69/udp \
  -e DOWNLOAD_NETBOOT_XYZ=true \
  -v /srv/tftp:/var/lib/tftpboot \
  gitea.bcde.io/wangdefa/tftpd:latest

这将自动下载:

  • netboot.xyz.efi - 用于 x86_64 UEFI 系统
  • netboot.xyz-arm64.efi - 用于 ARM64 UEFI 系统

Docker Compose

创建 docker-compose.yml 文件:

version: '3.8'

services:
  tftpd:
    image: gitea.bcde.io/wangdefa/tftpd:latest
    container_name: tftpd
    restart: unless-stopped
    ports:
      - "69:69/udp"
    volumes:
      - ./tftpboot:/var/lib/tftpboot
    environment:
      - DOWNLOAD_NETBOOT_XYZ=true

然后运行:

docker-compose up -d

架构

容器结构

tftpd/
├── Dockerfile              # 容器定义
├── entrypoint.sh          # 初始化脚本
└── .gitea/
    └── workflows/
        └── ci.yaml        # CI/CD 流水线
Description
No description provided
Readme 27 KiB
Languages
Shell 72%
Dockerfile 28%