Add alt/prometheus image

This commit is contained in:
Mikhail Gordeev 2022-12-20 00:55:37 +03:00
parent 9d6451a981
commit 21a8804c30
2 changed files with 35 additions and 0 deletions

View File

@ -0,0 +1,11 @@
FROM {{ registry }}{{ alt_image }}:{{ branch }}
MAINTAINER alt-cloud
{{ install_pakages("prometheus") }}
WORKDIR /var/lib/prometheus
USER prometheus
EXPOSE 9090
VOLUME [ "/var/lib/prometheus" ]
ENTRYPOINT [ "/usr/bin/prometheus", "--config.file=/etc/prometheus/prometheus.yml"]

View File

@ -0,0 +1,24 @@
# Prometheus image
Command for run:
```
docker run -d --name="prometheus" -p 9090:9090 -v promdata:/var/lib/prometheus IMAGENAME
```
*If you want to be able to view services on localhost, instead of -p, specify the flag:
```
--network="host"
```
Prometheus will see all the services running on your local hosting, without this it will not be able to access your ports
To upload your own configuration, create prometheus.yml, you can use example from:
```
https://raw.githubusercontent.com/prometheus/prometheus/main/documentation/examples/prometheus.yml
```
Then, while the container is running, enter its command:
```
docker cp $PWD/prometheus.yml prometheus:/etc/prometheus/prometheus.yml
docker restart prometheus
```