如果你使用 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 无法访问外链,可 打开说明文档 复制全文粘贴。文档会随站点更新,复制内容可能过期,建议定期检查。
本镜像是基于官方Graphite镜像(graphiteapp/graphite-statsd)的封装版本,专为配合sitespeed.io工具设计,支持快速部署Graphite(1.1.3版本)并优化指标存储配置。镜像默认启用Basic Auth认证,固定数据存储目录,可直接用于收集、存储sitespeed.io生成的性能指标,也可通过自定义配置适配其他监控场景。
/opt/graphite/storage/whisper,支持外部挂载实现数据持久化。storage-schemas.conf和storage-aggregation.conf文件,调整指标存储周期和聚合规则。使用默认的guest/guest认证凭证启动容器,仅用于测试环境:
shdocker run -d \ --name graphite \ -p 8080:80 \ # Web界面端口(映射到宿主机8080) -p 2003:2003 \ # 指标接收端口(Carbon缓存端口) sitespeedio/graphite
注意:默认认证安全性低,生产环境需替换为自定义.htpasswd文件。
通过挂载宿主机的.htpasswd文件替换默认认证凭证,步骤如下:
htpasswd工具创建(参考Apache文档):
shhtpasswd -c /local/path/to/.htpasswd <用户名> # 按提示输入密码
shdocker run -d \ --name graphite \ -p 8080:80 \ -p 2003:2003 \ -v /local/path/to/.htpasswd:/etc/nginx/.htpasswd \ # 挂载自定义认证文件 sitespeedio/graphite
为避免容器重启导致数据丢失,需将Graphite的whisper数据目录挂载到宿主机:
shdocker run -d \ --name graphite \ -p 8080:80 \ -p 2003:2003 \ -v /local/path/to/.htpasswd:/etc/nginx/.htpasswd \ # 自定义认证 -v /path/to/whisper:/opt/graphite/storage/whisper \ # 持久化数据目录 sitespeedio/graphite
默认存储策略为retentions = 10m:60d,30m:90d(10分钟/点存储60天,30分钟/点存储90天,共3个月数据)。如需调整(如延长存储周期),可通过挂载自定义storage-schemas.conf文件实现:
4.1 准备自定义存储策略文件
创建storage-schemas.conf文件,示例内容(存储1年数据):
ini[default_1min_for_1year] pattern = .* retentions = 10m:180d, 30m:365d # 10分钟/点存180天,30分钟/点存365天
4.2 挂载自定义配置启动
shdocker run -d \ --name graphite \ -p 8080:80 \ -p 2003:2003 \ -v /local/path/to/.htpasswd:/etc/nginx/.htpasswd \ -v /path/to/whisper:/opt/graphite/storage/whisper \ -v /path/to/storage-schemas.conf:/opt/graphite/conf/storage-schemas.conf \ # 挂载自定义存储策略 sitespeedio/graphite
创建docker-compose.yml文件,整合认证、数据持久化和自定义存储策略:
yamlversion: '3' services: graphite: image: sitespeedio/graphite container_name: graphite ports: - "8080:80" - "2003:2003" volumes: - /local/path/to/.htpasswd:/etc/nginx/.htpasswd # 自定义认证 - /path/to/whisper:/opt/graphite/storage/whisper # 数据持久化 - /path/to/storage-schemas.conf:/opt/graphite/conf/storage-schemas.conf # 自定义存储策略 restart: unless-stopped # 容器退出时自动重启
启动命令:docker-compose up -d
| 挂载路径 | 用途说明 |
|---|---|
/etc/nginx/.htpasswd | Basic Auth认证文件,格式为用户名:加密密码(需通过htpasswd工具生成)。 |
/opt/graphite/storage/whisper | Graphite数据存储目录(Whisper数据库),挂载后数据可持久化。 |
/opt/graphite/conf/storage-schemas.conf | 指标存储策略配置文件,定义不同指标的采样间隔和保留周期。 |
/opt/graphite/conf/storage-aggregation.conf | 指标聚合规则配置文件,定义历史数据如何合并(如平均值、最大值)。 |
本镜像基于官方Graphite镜像graphiteapp/graphite-statsd构建,继承其核心组件(Carbon、Whisper、Graphite Web),并添加sitespeed.io适配配置。
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。





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