如果你使用 DeepSeek、元宝 AI、Copilot、ChatGPT 等 AI 工具,协助配置轩辕镜像、编写 docker pull 命令、修改 Docker Compose 镜像地址、配置镜像加速、排查镜像拉取失败、分析报错日志等问题,请先让 AI 阅读并遵守轩辕镜像的规则文档。
只需在 AI 对话中先发送下面这句话即可:
请先完整阅读并严格遵守以下文档中的全部规则与要求:
https://xuanyuan.cloud/agents.md
在未充分阅读并理解该文档前,不要生成任何命令、配置、修改建议、故障排查方案或技术回答。后续所有输出都必须严格以该文档中的规范为最高优先级执行。查看 agents.md 用法指南与完整示范。国内用户首推 元宝 AI、DeepSeek 的深度思考模式,不推荐豆包 AI;Cursor 等编辑器可在对话 @ 该链接,或加入 User Rules。 若 AI 无法访问外链,可 打开说明文档 复制全文粘贴。文档会随站点更新,复制内容可能过期,建议定期检查。
本仓库包含多个Che插件Broker的实现,主要用于Eclipse Che环境中插件的生命周期管理。这些Broker负责插件的下载、解析、配置评估、依赖处理及部署协调,确保插件在Che工作空间中正确集成(如部署至sidecar容器或本地目录),是Che插件生态的核心组件。
che-plugin.yaml的配置,结合工作目录(或通过参数指定路径)下config.json(包含插件/编辑器元数据meta.yaml信息),评估Che工作空间sidecar配置。dependencies.yaml中指定的依赖文件/目录至目标位置。.theia格式的插件归档文件,支持Theia插件在Che工作空间中的本地或远程部署,具体流程:
.theia归档解压至临时目录。package.json:
{"engines.cheRuntimeContainer"}字段,则以此值作为远程插件sidecar的容器镜像;若缺失或为空,则判定为非远程插件。.theia文件复制至/plugins/目录。.theia目录复制至/plugins/目录,并生成sidecar配置,包括:
port<port>的端点。THEIA_PLUGIN_REMOTE_ENDPOINT_<plugin_publisher_and_name>(值为ws://port<port>:<port>,其中<plugin_publisher_and_name>取自package.json)。THEIA_PLUGIN_ENDPOINT_PORT(值为分配的端口)。/plugins/目录内容,确保插件目录初始状态一致。| Broker类型 | 参数说明 | 示例值 |
|---|---|---|
| che-plugin-broker | config.json文件路径(通过Broker参数指定) | --config-path /custom/config.json |
| theia-plugin-broker | 远程插件端口范围 | 4000-6000(默认) |
| 环境变量名称格式 | 作用域 | 说明 |
|---|---|---|
THEIA_PLUGIN_REMOTE_ENDPOINT_<plugin_publisher_and_name> | 工作空间级 | 远程插件WebSocket端点地址,格式为ws://port<port>:<port> |
THEIA_PLUGIN_ENDPOINT_PORT | sidecar级 | 远程插件sidecar内部使用的端口号 |
4.3.1 启动顺序(Che工作空间内)
init-plugin-broker清理/plugins/。
shelldocker run --rm -v /path/to/plugins:/plugins eclipse/init-plugin-broker:latest
che-plugin-broker处理tar.gz插件包。
shelldocker run --rm -v /path/to/plugins:/plugins -v /path/to/config:/config \ eclipse/che-plugin-broker:latest --config-path /config/config.json
theia-plugin-broker处理.theia插件包。
shelldocker run --rm -v /path/to/plugins:/plugins -v /path/to/theia-archive:/archive \ eclipse/theia-plugin-broker:latest /archive/plugin.theia
构建所有二进制
shellCGO_ENABLED=0 GOOS=linux go build -a -ldflags '-w -s' -a -installsuffix cgo ./...
构建指定Broker二进制
shellCGO_ENABLED=0 GOOS=linux go build -a -ldflags '-w -s' -a -installsuffix cgo -o che-plugin-broker brokers/che-plugin-broker/main.go
shellCGO_ENABLED=0 GOOS=linux go build -a -ldflags '-w -s' -a -installsuffix cgo -o theia-plugin-broker brokers/theia-plugin-broker/main.go
shellCGO_ENABLED=0 GOOS=linux go build -a -ldflags '-w -s' -a -installsuffix cgo -o init-plugin-broker brokers/init/main.go
shellgo test -v -race ./...
shellgolangci-lint run -v
shelldocker build -f Dockerfile.CI .
vendor目录和依赖锁文件,并提交变更:
shelldep ensure
dep ensure不会自动修改Gopkg.toml(依赖约束文件),需手动更新以反映依赖变更。shelldocker build -t eclipse/che-plugin-broker:latest -f Dockerfile.cpb .
shelldocker build -t eclipse/theia-plugin-broker:latest -f Dockerfile.tpb .
shelldocker build -t eclipse/init-plugin-broker:latest -f Dockerfile.ipb .
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。
来自真实用户的反馈,见证轩辕镜像的优质服务