标准服务模板¶
标准服务模板用于快速声明常见角色的服务配置,通过 ref: "std:<role>" 与服务的 image 软件类型组合进行解析
解析规则¶
- 当
ref写作std:<role>时,解析器会读取服务的image,获取其软件类型(如bind、unbound),并将std:<role>解释为<software>:<role> - 若未设置
image或无法识别软件类型,将报错 - 也可直接写
<software>:<role>(如bind:auth、unbound:recursor),跳过std:组合解析
可用模板¶
内置模板位于资源路径 resource:/builder/templates,当前包含:
-
bindrecursor:递归解析器,挂载bind_recursor_base.conf等auth:权威服务器,挂载bind_auth_base.confforwarder:转发器,挂载bind_forwarder_base.confunbound
recursor:递归解析器,挂载unbound_recursor_base.confforwarder:转发器,挂载unbound_forwarder_base.conf
使用示例¶
builds:
recursor:
image: "bind"
ref: "std:recursor"
root:
image: "bind"
ref: "bind:auth" # 显式写法
变量占位与挂载¶
模板中可能包含占位符(如 ${project.inet}、${origin}、${required}),在构建流程中会由变量替换器解析。详见行为 DSL与内置变量章节