Keep image generic; move startup settings into run.sh/compose
All checks were successful
Docker Build and Push / docker (push) Successful in 1h29m12s

This commit is contained in:
2026-10-26 18:53:54 +08:00
parent 9f523e208a
commit d0e260c322
4 changed files with 25 additions and 17 deletions

View File

@@ -4,13 +4,13 @@
# - Llama-4-Scout-17B-16E-Instruct(BF16,TP8,8 卡)
# - Llama-4-Maverick-17B-128E-Instruct-FP8(FP8,TP8+PP2,16 卡)
#
# 模型权重不打进镜像,运行时挂载模型目录;容器启动后读取 config.json
# 自动判断 Scout / Maverick,并选择对应的 TP / PP / 端口。
# 镜像只包含运行时依赖和 Llama 4 补丁,不设置启动命令、ENV、WORKDIR 或 EXPOSE;
# 模型路径、端口、TP/PP、GPU、挂载等全部由 run.sh / docker-compose.yml 在启动时传入。
#
# 构建:
# docker build -t llama4-bi150:2026-10-26 .
#
# 运行:
# 运行(由 run.sh 传入 entrypoint 和全部参数):
# ./run.sh /mnt/disk0/models/LLM-Research/Llama-4-Scout-17B-16E-Instruct
# ./run.sh /mnt/disk0/models/LLM-Research/Llama-4-Maverick-17B-128E-Instruct-FP8
#
@@ -35,16 +35,5 @@ RUN chmod +x /usr/local/bin/llama4-entrypoint.sh \
&& chmod +x /opt/llama4/detect_model.py \
&& python3 /opt/llama4/apply_patch.py
ENV MODEL_PATH=/models/llama4 \
AUTO_DETECT=1 \
HOST=0.0.0.0 \
MAX_MODEL_LEN=4096 \
MAX_NUM_SEQS=1 \
GPU_MEM_UTIL=0.90 \
ENFORCE_EAGER=1 \
PYTHONUNBUFFERED=1
WORKDIR /opt/llama4
EXPOSE 8091 8092
ENTRYPOINT ["/usr/local/bin/llama4-entrypoint.sh"]
# 故意不设置 ENV / WORKDIR / EXPOSE / ENTRYPOINT / CMD:
# 镜像保持通用,启动方式由 run.sh 或 docker-compose.yml 决定。