xfy 9851f98dc0 chore(docker): setup sandboxed runtime containers and build script
- runner-base: alpine 3.18 + 非 root 用户 1000:1000 + /code 工作目录
- runner-python: 基于 base, apk add python3 + python 符号链接(对齐 run_cmd 'python')
- runner-node: 基于 base, apk add nodejs
- runner.toml: 镜像自描述(运行时实际配置由 Rust LANGUAGES 注册表 + 环境变量决定)
- build-runners.sh: 按 base→python→node 顺序构建, tag 与 languages.rs 严格对齐
2026-07-03 18:48:03 +08:00

17 lines
615 B
Docker
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Python 运行沙箱镜像。
# 与 src/api/code_runner/languages.rs 的 python 注册项对齐:
# image: yggdrasil-runner-python:latest
# run_cmd: python /code/main.py
#
# 注意alpine 的 python3 包只提供 `python3`,这里建 `python` 符号链接以匹配 run_cmd。
# 运行时src/infra/docker.rs以 user 1000:1000、只读根文件系统 + tmpfs /code 挂载容器,
# 源码通过 stdin 写入 /code/main.py 后 exec run_cmd。
FROM yggdrasil-runner-base:latest
RUN apk add --no-cache python3 \
&& ln -sf /usr/bin/python3 /usr/bin/python
COPY runner.toml /runner.toml
USER runner