- 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 严格对齐
17 lines
615 B
Docker
17 lines
615 B
Docker
# 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
|