本镜像是基于官方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适配配置。
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。
探索更多轩辕镜像的使用方法,找到最适合您系统的配置方式
通过 Docker 登录认证访问私有仓库
无需登录使用专属域名
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
新手拉取配置
镜像合规机制
manifest unknown
no matching manifest(架构)
invalid tar header(解压)
TLS 证书失败
DNS 超时
域名连通性排查
410 Gone 排查
402 与流量用尽
401 认证失败
429 限流
D-Bus 凭证提示
413 与超大单层
来自真实用户的反馈,见证轩辕镜像的优质服务