mirror of
https://github.com/yeasy/docker_practice.git
synced 2026-08-10 16:37:34 +00:00
Pin Prometheus and Grafana image versions
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user