leo wu commited on
Commit
2ef9ed5
·
verified ·
1 Parent(s): b3edd69

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +15 -9
Dockerfile CHANGED
@@ -1,16 +1,22 @@
1
- # 使用 Prometheus 官方镜像
2
- FROM prom/prometheus:v2.43.0
3
 
4
- # 设置 Prometheus 配置文件和数据存储路径
5
- COPY prometheus.yml /etc/prometheus/prometheus.yml
6
- VOLUME ["/prometheus"]
 
 
 
 
 
 
 
7
 
8
  # 设置工作目录
9
- WORKDIR /etc/prometheus
10
 
11
- # 曝露 Prometheus 默认端口
12
  EXPOSE 9090
13
 
14
  # 启动 Prometheus
15
- ENTRYPOINT ["/bin/prometheus"]
16
- CMD ["--config.file=/etc/prometheus/prometheus.yml", "--storage.tsdb.path=/prometheus"]
 
1
+ # 使用 Ubuntu 作为基础镜像
2
+ FROM ubuntu:20.04
3
 
4
+ # 安装必要的软件
5
+ RUN apt-get update && apt-get install -y wget
6
+
7
+ # 下载 Prometheus
8
+ RUN wget https://github.com/prometheus/prometheus/releases/download/v2.43.0/prometheus-2.43.0.linux-amd64.tar.gz && \
9
+ tar -xvzf prometheus-2.43.0.linux-amd64.tar.gz && \
10
+ rm prometheus-2.43.0.linux-amd64.tar.gz
11
+
12
+ # 将 Prometheus 配置文件复制到容器中
13
+ COPY prometheus.yml /prometheus/prometheus.yml
14
 
15
  # 设置工作目录
16
+ WORKDIR /prometheus/prometheus-2.43.0.linux-amd64
17
 
18
+ # 暴露 Prometheus 默认端口
19
  EXPOSE 9090
20
 
21
  # 启动 Prometheus
22
+ CMD ["./prometheus", "--config.file=/prometheus/prometheus.yml", "--storage.tsdb.path=/prometheus"]