Pin Prometheus and Grafana image versions

This commit is contained in:
yeasy
2026-04-22 12:24:31 -07:00
parent 4b4fe377dc
commit ae7aaaab1b
2 changed files with 8 additions and 8 deletions
+5 -5
View File
@@ -51,12 +51,12 @@ rule_files:
#### 2. 编写 Docker Compose 文件
创建 `compose.yaml` ( `docker-compose.yml`)
创建 `compose.yaml` ( `docker-compose.yml`)下面示例使用的是 2026 4 月的稳定版本对于生产环境部署建议查阅 [Prometheus 官方文档](https://prometheus.io/docs/prometheus/latest/installation/) 确认最新推荐版本:
```yaml
services:
prometheus:
image: prom/prometheus:latest
image: prom/prometheus:v3.11.0
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml
- ./rules.yml:/etc/prometheus/rules.yml
@@ -71,7 +71,7 @@ services:
- monitoring
grafana:
image: grafana/grafana:latest
image: grafana/grafana:11.3.0
ports:
- "3000:3000"
environment:
@@ -82,7 +82,7 @@ services:
- prometheus
node-exporter:
image: prom/node-exporter:latest
image: prom/node-exporter:v1.8.2
ports:
- "9100:9100"
networks:
@@ -241,7 +241,7 @@ receivers:
```yaml
alertmanager:
image: prom/alertmanager:latest
image: prom/alertmanager:v0.27.0
volumes:
- ./alertmanager.yml:/etc/alertmanager/alertmanager.yml
ports:
@@ -161,7 +161,7 @@ scrape_configs:
```yaml
services:
prometheus:
image: prom/prometheus:latest
image: prom/prometheus:v3.11.0
container_name: prometheus
ports:
- "9090:9090"
@@ -176,7 +176,7 @@ services:
- monitoring
node-exporter:
image: prom/node-exporter:latest
image: prom/node-exporter:v1.8.2
container_name: node-exporter
ports:
- "9100:9100"
@@ -206,7 +206,7 @@ services:
- monitoring
grafana:
image: grafana/grafana:latest
image: grafana/grafana:11.3.0
container_name: grafana
ports:
- "3000:3000"