Spaces:
Paused
Paused
leo wu commited on
Update Dockerfile
Browse files- Dockerfile +15 -9
Dockerfile
CHANGED
|
@@ -1,16 +1,22 @@
|
|
| 1 |
-
# 使用
|
| 2 |
-
FROM
|
| 3 |
|
| 4 |
-
#
|
| 5 |
-
|
| 6 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
|
| 8 |
# 设置工作目录
|
| 9 |
-
WORKDIR /
|
| 10 |
|
| 11 |
-
#
|
| 12 |
EXPOSE 9090
|
| 13 |
|
| 14 |
# 启动 Prometheus
|
| 15 |
-
|
| 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"]
|
|
|