Repository navigation
feat(docker): 运行时镜像预装 python3,修复内置 web 技能不可用 - #21
Merged
Merged
Conversation
内置 web 技能的 webctl.py 依赖 Python 3,而 golang:1.25-alpine 基础镜像 不自带,容器环境下开箱即用会报找不到解释器。运行时阶段补装 python3, 同步更新 docs/guide/docker.md 与 configuration.md 中的镜像说明。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题
运行时阶段基于
golang:1.25-alpine,apk add里只有ca-certificates tzdata git nodejs npm bash,没有 python3。而内置
web技能(skills/.builtin/web/webctl.py)是 Python 3 脚本,README /docs/guide/configuration.md里给的使用方式也是python3 "<webctl.py 路径>" ...。结果是容器部署下这个内置技能一调用就报找不到解释器,需要使用者自己进容器手动apk add python3,且重建镜像后又丢。改动
Dockerfile:运行时阶段apk add --no-cache ... python3,附注释说明用途。docs/guide/docker.md:工具链说明补上 Python 3,并加一条「Python 3 已预装」的说明。docs/guide/configuration.md:web 技能小节补充「官方镜像已预装 Python 3;自行构建的精简镜像请确保存在 python3」。影响
--no-cache不留 apk 索引)。验证
本地无 docker 环境,未实际构建镜像;改动仅是在运行时层多装一个 alpine 官方包,风险低。建议合并前跑一次镜像构建确认。