[修改]调整了Prometheus与opcua exporter的dockerfile路径,修正了confd模版

This commit is contained in:
makotocc0107
2024-09-11 11:11:05 +08:00
committed by Coding
parent 0021d2da26
commit c2794f29ee
5 changed files with 33 additions and 5 deletions

View File

@@ -15,8 +15,10 @@ RUN curl -fsSL https://github.com/abtreece/confd/releases/download/v0.20.0/confd
RUN mkdir /etc/prometheus/ RUN mkdir /etc/prometheus/
COPY ./confd/ /etc/confd/
COPY prometheus.yml /etc/prometheus/prometheus.yml COPY prometheus.yml /etc/prometheus/prometheus.yml
COPY COPY ./supervisord/ /etc/supervisord/ COPY ./supervisord/ /etc/supervisord/
CMD [ "supervisord", "-c", "/etc/supervisord/supervisord.conf" ] CMD [ "supervisord", "-c", "/etc/supervisord/supervisord.conf" ]

View File

@@ -1,8 +1,6 @@
[template] [template]
src = "prometheus.tmpl" src = "prometheus.tmpl"
dest = "/prometheus.yml" dest = "/etc/prometheus/prometheus.yml"
keys = [ keys = [
"/time/", "/time/",
]a ]

View File

@@ -0,0 +1,6 @@
[template]
src = "supervisord.tmpl"
dest = "/etc/supervisord/supervisord.conf"
keys = [
"/time/"
]

View File

@@ -0,0 +1,18 @@
[supervisord]
nodaemon=true ; 让 supervisor 运行在前台,保持容器不退出
logfile=/var/log/supervisor/supervisord.log
pidfile=/var/run/supervisord.pid
[program:confd]
command=/usr/local/bin/confd -config-file /etc/confd/confd.toml
autostart=true
autorestart=true
stderr_logfile=/var/log/confd.err.log
stdout_logfile=/var/log/confd.out.log
[program:prometheus]
command=/usr/local/bin/prometheus --config.file=/etc/prometheus/prometheus.yml --storage.tsdb.retention.time={{ getv "/time/storage_interval" }}
autostart=true
autorestart=true
stderr_logfile=/var/log/prometheus.err.log
stdout_logfile=/var/log/prometheus.out.log

View File

@@ -47,6 +47,10 @@ RUN dnf update -y && \
RUN curl -fsSL https://github.com/abtreece/confd/releases/download/v0.20.0/confd-v0.20.0-linux-amd64.tar.gz | tar -xz -C /usr/local/bin && \ RUN curl -fsSL https://github.com/abtreece/confd/releases/download/v0.20.0/confd-v0.20.0-linux-amd64.tar.gz | tar -xz -C /usr/local/bin && \
chmod +x /usr/local/bin/confd chmod +x /usr/local/bin/confd
RUN mkdir /etc/opcua
COPY ./confd/ /etc/confd/
COPY ./supervisord/ /etc/supervisord/ COPY ./supervisord/ /etc/supervisord/
COPY --from=build /app/build/opcua_exporter /usr/local/bin COPY --from=build /app/build/opcua_exporter /usr/local/bin