This repository has been archived by the owner on Jun 27, 2024. It is now read-only.
generated from homecentr/docker-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
24 changed files
with
361 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
* text=auto | ||
*.sh eol=lf | ||
**/run eol=lf | ||
*/services.d/* eol=lf | ||
**/finish eol=lf | ||
*/services.d/* eol=lf | ||
*/alertmanager.yml eof=lf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,19 @@ | ||
FROM alpine | ||
FROM prom/alertmanager:v0.21.0 as original | ||
|
||
FROM homecentr/base:2.4.0-alpine | ||
|
||
ENV ALERTMANAGER_ARGS="" | ||
|
||
COPY --from=original /bin/amtool /bin/amtool | ||
COPY --from=original /bin/alertmanager /bin/alertmanager | ||
|
||
COPY ./fs/ / | ||
|
||
RUN mkdir /config && \ | ||
mkdir /alertmanager && \ | ||
chmod 777 /alertmanager | ||
|
||
EXPOSE 9093 | ||
|
||
VOLUME /config | ||
VOLUME /alertmanager |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,58 @@ | ||
[![Project status](https://badgen.net/badge/project%20status/stable%20%26%20actively%20maintaned?color=green)](https://github.com/homecentr/docker-$$IMAGE_NAME$$/graphs/commit-activity) [![](https://badgen.net/github/label-issues/homecentr/docker-$$IMAGE_NAME$$/bug?label=open%20bugs&color=green)](https://github.com/homecentr/docker-$$IMAGE_NAME$$/labels/bug) [![](https://badgen.net/github/release/homecentr/docker-$$IMAGE_NAME$$)](https://hub.docker.com/repository/docker/homecentr/$$IMAGE_NAME$$) | ||
[![](https://badgen.net/docker/pulls/homecentr/$$IMAGE_NAME$$)](https://hub.docker.com/repository/docker/homecentr/$$IMAGE_NAME$$) | ||
[![](https://badgen.net/docker/size/homecentr/$$IMAGE_NAME$$)](https://hub.docker.com/repository/docker/homecentr/$$IMAGE_NAME$$) | ||
[![Project status](https://badgen.net/badge/project%20status/stable%20%26%20actively%20maintaned?color=green)](https://github.com/homecentr/docker-prometheus-alertmanager/graphs/commit-activity) [![](https://badgen.net/github/label-issues/homecentr/docker-prometheus-alertmanager/bug?label=open%20bugs&color=green)](https://github.com/homecentr/docker-prometheus-alertmanager/labels/bug) [![](https://badgen.net/github/release/homecentr/docker-prometheus-alertmanager)](https://hub.docker.com/repository/docker/homecentr/prometheus-alertmanager) | ||
[![](https://badgen.net/docker/pulls/homecentr/prometheus-alertmanager)](https://hub.docker.com/repository/docker/homecentr/prometheus-alertmanager) | ||
[![](https://badgen.net/docker/size/homecentr/prometheus-alertmanager)](https://hub.docker.com/repository/docker/homecentr/prometheus-alertmanager) | ||
|
||
![CI/CD on master](https://github.com/homecentr/docker-$$IMAGE_NAME$$/workflows/CI/CD%20on%20master/badge.svg) | ||
![Regular Docker image vulnerability scan](https://github.com/homecentr/docker-$$IMAGE_NAME$$/workflows/Regular%20Docker%20image%20vulnerability%20scan/badge.svg) | ||
![CI/CD on master](https://github.com/homecentr/docker-prometheus-alertmanager/workflows/CI/CD%20on%20master/badge.svg) | ||
![Regular Docker image vulnerability scan](https://github.com/homecentr/docker-prometheus-alertmanager/workflows/Regular%20Docker%20image%20vulnerability%20scan/badge.svg) | ||
|
||
|
||
# HomeCentr - $$IMAGE_NAME$$ | ||
# HomeCentr - prometheus-alertmanager | ||
|
||
This Docker image is a repack of the original [Prometheus Alertmanager](https://github.com/prometheus/alertmanager) with the usual Homecentr bells and whistles. | ||
|
||
|
||
## Usage | ||
|
||
```yml | ||
version: "3.7" | ||
services: | ||
$$IMAGE_NAME$$: | ||
prometheus-alertmanager: | ||
build: . | ||
image: homecentr/$$IMAGE_NAME$$ | ||
image: homecentr/prometheus-alertmanager:local | ||
environment: | ||
ALERTMANAGER_ARGS: "--log.level=debug" | ||
volumes: | ||
- ./example:/config | ||
ports: | ||
- 9093:9093 | ||
restart: unless-stopped | ||
``` | ||
|
||
## Environment variables | ||
|
||
| Name | Default value | Description | | ||
|------|---------------|-------------| | ||
| PUID | 7077 | UID of the user $$IMAGE_NAME$$ should be running as. | | ||
| PGID | 7077 | GID of the user $$IMAGE_NAME$$ should be running as. | | ||
| PUID | 7077 | UID of the user prometheus-alertmanager should be running as. | | ||
| PGID | 7077 | GID of the user prometheus-alertmanager should be running as. | | ||
| ALERTMANAGER_ARGS | | Additional command line arguments passed to the Alertmanager executable. Do not specify the `--config.file` and `--storage.path` these are already set by the image. | | ||
|
||
## Exposed ports | ||
|
||
| Port | Protocol | Description | | ||
|------|------|-------------| | ||
| 80 | TCP | Some useful details | | ||
| 9093 | TCP | Alert manager API | | ||
|
||
## Volumes | ||
|
||
| Container path | Description | | ||
|------------|---------------| | ||
| /config | Some useful details | | ||
| /config | [Alertmanager Configuration](https://github.com/prometheus/alertmanager#example). The configuration should be in `/config/alertmanager.yml`. | | ||
| /alertmanager | Alertmanager state in case it is restarted. Make sure the PUID/PGID grants the process the rights to write into this directory. | | ||
|
||
## Security | ||
The container is regularly scanned for vulnerabilities and updated. Further info can be found in the [Security tab](https://github.com/homecentr/docker-$$IMAGE_NAME$$/security). | ||
The container is regularly scanned for vulnerabilities and updated. Further info can be found in the [Security tab](https://github.com/homecentr/docker-prometheus-alertmanager/security). | ||
|
||
### Container user | ||
The container supports privilege drop. Even though the container starts as root, it will use the permissions only to perform the initial set up. The $$IMAGE_NAME$$ process runs as UID/GID provided in the PUID and PGID environment variables. | ||
The container supports privilege drop. Even though the container starts as root, it will use the permissions only to perform the initial set up. The prometheus-alertmanager process runs as UID/GID provided in the PUID and PGID environment variables. | ||
|
||
:warning: Do not change the container user directly using the `user` Docker compose property or using the `--user` argument. This would break the privilege drop logic. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,12 @@ | ||
version: "3.7" | ||
services: | ||
$$IMAGE_NAME$$: | ||
prometheus-alertmanager: | ||
build: . | ||
image: homecentr/$$IMAGE_NAME$$ | ||
image: homecentr/prometheus-alertmanager:local | ||
environment: | ||
ALERTMANAGER_ARGS: "--log.level=debug" | ||
volumes: | ||
- ./example:/config | ||
ports: | ||
- 9093:9093 | ||
restart: unless-stopped |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
global: | ||
# The smarthost and SMTP sender used for mail notifications. | ||
smtp_smarthost: 'localhost:25' | ||
smtp_from: '[email protected]' | ||
|
||
# The root route on which each incoming alert enters. | ||
route: | ||
# The root route must not have any matchers as it is the entry point for | ||
# all alerts. It needs to have a receiver configured so alerts that do not | ||
# match any of the sub-routes are sent to someone. | ||
receiver: 'team-X-mails' | ||
|
||
# The labels by which incoming alerts are grouped together. For example, | ||
# multiple alerts coming in for cluster=A and alertname=LatencyHigh would | ||
# be batched into a single group. | ||
# | ||
# To aggregate by all possible labels use '...' as the sole label name. | ||
# This effectively disables aggregation entirely, passing through all | ||
# alerts as-is. This is unlikely to be what you want, unless you have | ||
# a very low alert volume or your upstream notification system performs | ||
# its own grouping. Example: group_by: [...] | ||
group_by: ['alertname'] | ||
|
||
# When a new group of alerts is created by an incoming alert, wait at | ||
# least 'group_wait' to send the initial notification. | ||
# This way ensures that you get multiple alerts for the same group that start | ||
# firing shortly after another are batched together on the first | ||
# notification. | ||
group_wait: 30s | ||
|
||
# When the first notification was sent, wait 'group_interval' to send a batch | ||
# of new alerts that started firing for that group. | ||
group_interval: 5m | ||
|
||
# If an alert has successfully been sent, wait 'repeat_interval' to | ||
# resend them. | ||
repeat_interval: 3h | ||
|
||
# All the above attributes are inherited by all child routes and can | ||
# overwritten on each. | ||
|
||
# The child route trees. | ||
routes: | ||
# This routes performs a regular expression match on alert labels to | ||
# catch alerts that are related to a list of services. | ||
- match_re: | ||
service: ^(foo1|foo2|baz)$ | ||
receiver: team-X-mails | ||
|
||
# The service has a sub-route for critical alerts, any alerts | ||
# that do not match, i.e. severity != critical, fall-back to the | ||
# parent node and are sent to 'team-X-mails' | ||
routes: | ||
- match: | ||
severity: critical | ||
receiver: team-X-pager | ||
|
||
|
||
# Inhibition rules allow to mute a set of alerts given that another alert is | ||
# firing. | ||
# We use this to mute any warning-level notifications if the same alert is | ||
# already critical. | ||
inhibit_rules: | ||
- source_match: | ||
severity: 'critical' | ||
target_match: | ||
severity: 'warning' | ||
# Apply inhibition if the alertname is the same. | ||
# CAUTION: | ||
# If all label names listed in `equal` are missing | ||
# from both the source and target alerts, | ||
# the inhibition rule will apply! | ||
equal: ['alertname'] | ||
|
||
receivers: | ||
- name: 'team-X-mails' | ||
email_configs: | ||
- to: '[email protected], [email protected]' | ||
|
||
- name: 'team-X-pager' | ||
email_configs: | ||
- to: '[email protected]' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/usr/bin/execlineb -S1 | ||
|
||
s6-svscanctl -t /var/run/s6/services |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/usr/bin/with-contenv ash | ||
|
||
cd /alertmanager | ||
|
||
exec runas /bin/alertmanager --config.file=/config/alertmanager.yml --storage.path=/alertmanager $ALERTMANAGER_ARGS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
{ | ||
"name": "homecentr-$$IMAGE_NAME$$", | ||
"name": "homecentr-prometheus-alertmanager", | ||
"version": "1.0.0", | ||
"description": "", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/homecentr/docker-$$IMAGE_NAME$$.git" | ||
"url": "git+https://github.com/homecentr/docker-prometheus-alertmanager.git" | ||
}, | ||
"author": "", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/homecentr/docker-$$IMAGE_NAME$$/issues" | ||
"url": "https://github.com/homecentr/docker-prometheus-alertmanager/issues" | ||
}, | ||
"homepage": "https://github.com/homecentr/docker-$$IMAGE_NAME$$#readme" | ||
"homepage": "https://github.com/homecentr/docker-prometheus-alertmanager#readme" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.