
如果你用 DeepSeek、元宝AI、Copilot 等 AI 代为编写轩辕镜像的 docker pull、修改 compose 镜像地址,或排查拉取失败等问题,请让 AI 先读规则再动手,只要在 AI 对话里直接发送下面这句话即可:
生成 docker pull、修改 compose 的 image,或排查拉取失败前,请先阅读并严格遵守 https://xuanyuan.cloud/agents.md 中的规则。国内用户首推 元宝 AI、DeepSeek 的深度思考模式,不推荐豆包 AI;Cursor 等编辑器可在对话 @ 该链接,或加入 User Rules。 若 AI 无法访问外链,可 打开说明文档 复制全文粘贴。文档会随站点更新,复制内容可能过期,建议定期检查。
Prometheus AWS/Azure Tag based Discovery 提供了一种更灵活的服务发现机制,用于自动发现运行在 AWS EC2 实例或 Azure VMSS(虚拟机规模集)实例上的 Exporter。该镜像通过解析云资源的标签(Tags),生成兼容 Prometheus file_sd_config 格式的配置文件,从而克服了原生 ec2_sd_configs 在端口和路径配置上的局限性。
aws: 前缀标签。AWS 认证通过 AWS Go SDK 实现,默认支持以下认证方式:
Azure 认证需要通过环境变量提供凭证。支持的凭证组合请参考 https://github.com/Azure/azure-sdk-for-go#more-authentication-details%E3%80%82
原生 Prometheus 的 ec2_sd_configs 功能有限,不支持扩展发现(例如只能在配置文件中指定固定的端口列表)。本项目通过解析 EC2/VMSS 标签,生成 file_sd_config 可读取的格式来解决此问题。
如果在启动时提供 --tag 参数,程序将查找 V2 标签结构。该结构允许在 Value 中使用 JSON 数组定义多个监控目标。
标签格式:
textKey: example Value: [{"name": "ref-test","port": 9100,"path": "metrics","scheme": "https"}, {"name": "app-metrics","port": 8080,"path": "/metrics","scheme": "http"}]
如果提供 --tag-prefix 参数,程序将查找 V1 标签结构。
标签格式:
textKey: <prefix>:<port>/<path> Value: <name>
参数说明:
prefix:可通过命令行参数配置,默认为 prom/scrape。port:应用或 Exporter 监听的端口。path:Exporter 或应用提供的 metrics 路径(例如 /metrics)。name:作为 label 添加到 metrics 中的名称。示例:
textKey: prom/scrape:9100/metrics Value: node_exporter
生成的 file_sd_config 输出:
json[ { "targets": [ "<private-ip-address>:9100" ], "labels": { "__address__": "<private-ip-address>:9100", "__metrics_path__": "/metrics", "instancename": "<Name-Tag>", "name": "node_exporter", "...": "..." } } ]
注:... 代表与 EC2 实例关联的其他标签列表,所有以 aws: 开头的 AWS 特定标签将被自动移除。
使用 IAM 实例配置文件(Instance Profile)进行认证,并指定 V2 标签发现:
bashdocker run -d \ --name prometheus-discovery \ -v /path/to/output:/output \ -e AWS_REGION=us-east-1 \ prometheus-tag-discovery:latest \ --tag example \ --output /output/targets.json
使用环境变量进行 Azure 认证,并指定 V1 标签前缀:
yamlversion: '3.8' services: prometheus-discovery: image: prometheus-tag-discovery:latest container_name: prometheus-discovery environment: - AZURE_CLIENT_ID=<your-client-id> - AZURE_CLIENT_SECRET=<your-client-secret> - AZURE_TENANT_ID=<your-tenant-id> - AZURE_SUBSCRIPTION_ID=<your-subscription-id> volumes: - ./sd-config:/output command: - "--tag-prefix=prom/scrape" - "--output=/output/targets.json" restart: unless-stopped
在 Prometheus 的 prometheus.yml 中配置文件服务发现,指向该镜像生成的 JSON 文件:
yamlscrape_configs: - job_name: 'cloud-instances' file_sd_configs: - files: - '/path/to/sd-config/targets.json' refresh_interval: 5m
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。




探索更多轩辕镜像的使用方法,找到最适合您系统的配置方式
通过 Docker 登录认证访问私有仓库
发给 Cursor、ChatGPT、豆包等 AI 的说明文档
无需登录使用专属域名
Kubernetes 集群配置 Containerd
K3s 轻量级 Kubernetes 镜像加速
VS Code Dev Containers 配置
Podman 容器引擎配置
HPC 科学计算容器配置
ghcr、Quay、nvcr 等镜像仓库
Harbor Proxy Repository 对接专属域名
Portainer Registries 加速拉取
Nexus3 Docker Proxy 内网缓存
需要其他帮助?请查看我们的 常见问题Docker 镜像访问常见问题解答 或 提交工单
docker search 限制
站内搜不到镜像
离线 save/load
插件要用 plugin install
WSL 拉取慢
安全与 digest
新手拉取配置
镜像合规机制
不支持 push
manifest unknown
no matching manifest(架构)
invalid tar header(解压)
TLS 证书失败
DNS 超时
域名连通性排查
410 Gone 排查
402 与流量用尽
401 认证失败
429 限流
D-Bus 凭证提示
413 与超大单层
来自真实用户的反馈,见证轩辕镜像的优质服务