如果你使用 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 无法访问外链,可 打开说明文档 复制全文粘贴。文档会随站点更新,复制内容可能过期,建议定期检查。
Testcontainers Cloud Operator for OpenShift是基于Kubernetes Operator模式构建的管理工具,专为OpenShift平台设计,用于自动化Testcontainers Cloud在容器化测试环境中的资源管理。作为OpenShift原生组件,它通过自定义资源定义(CRD)抽象测试环境配置逻辑,简化Testcontainers Cloud与OpenShift集群的集成过程,提升测试环境的一致性和运维效率。
oc命令行工具(配置集群管理员权限)方法1:通过OperatorHub部署(推荐)
stable-v1)方法2:手动部署
应用CRD定义:
bashoc apply -f https://raw.githubusercontent.com/testcontainers/testcontainers-cloud-operator/main/config/crd/bases/cloud.testcontainers.com_testcontainersclouds.yaml
创建专用命名空间:
bashoc create namespace testcontainers-system
部署Operator控制器:
bashoc apply -f https://raw.githubusercontent.com/testcontainers/testcontainers-cloud-operator/main/deploy/operator.yaml -n testcontainers-system
创建TestcontainersCloud自定义资源(CR)配置文件(示例):
yamlapiVersion: cloud.testcontainers.com/v1alpha1 kind: TestcontainersCloud metadata: name: test-env namespace: testcontainers-system spec: # Testcontainers Cloud API密钥(必填) apiKey: "tc-cloud-api-key-xxxx" # 资源分配配置 resources: limits: cpu: "2" memory: "2Gi" requests: cpu: "1" memory: "1Gi" # 代理服务配置 proxy: enabled: true port: 8080 image: "testcontainers/cloud-proxy:latest" # 日志配置 logging: level: "info" destination: "stdout" # 自动扩缩容配置(可选) autoscaling: minReplicas: 1 maxReplicas: 3 targetCPUUtilizationPercentage: 70
应用配置:
bashoc apply -f testcontainers-cloud-cr.yaml -n testcontainers-system
检查Operator运行状态:
bashoc get pods -n testcontainers-system # 预期输出包含运行中的operator pod:testcontainers-cloud-operator-xxxx-xxxx
检查Testcontainers Cloud资源状态:
bashoc get testcontainersclouds -n testcontainers-system # 预期输出:NAME READY STATUS AGE # test-env True Running 5m
Operator控制器支持通过Deployment资源调整以下环境变量:
| 环境变量 | 描述 | 默认值 |
|---|---|---|
WATCH_NAMESPACE | 监控范围(为空时监控所有命名空间) | "" |
RECONCILIATION_INTERVAL | 资源调和周期(秒) | 30 |
MAX_RECONCILIATION_RETRIES | 资源调和最大重试次数 | 5 |
OPERATOR_LOG_LEVEL | 日志级别(debug/info/warn/error) | "info" |
修改方法:
bashoc set env deployment/testcontainers-cloud-operator -n testcontainers-system OPERATOR_LOG_LEVEL=debug
删除Testcontainers Cloud资源实例:
bashoc delete testcontainersclouds test-env -n testcontainers-system
卸载Operator(OperatorHub部署场景):
清理CRD及残留资源:
bashoc delete crd testcontainersclouds.cloud.testcontainers.com oc delete namespace testcontainers-system
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。






来自真实用户的反馈,见证轩辕镜像的优质服务