Skip to content

Commit

Permalink
ci: publish dockerimage
Browse files Browse the repository at this point in the history
  • Loading branch information
wbollock committed Mar 6, 2023
1 parent f55b76a commit 510e122
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 1 deletion.
17 changes: 17 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,23 @@ changelog:
exclude:
- '^docs:'
- '^test:'
dockers:
# build latest and specific tag version images
- image_templates:
- "ghcr.io/wbollock/{{.ProjectName}}:{{ .Tag }}"
- "ghcr.io/wbollock/{{.ProjectName}}:latest"
goos: linux
goarch: amd64
use: docker
build_flag_templates:
- "--pull"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.title={{.ProjectName}}"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}"
- "--label=org.opencontainers.image.source=https://github.com/wbollock/nagios_exporter"
- "--label=org.opencontainers.image.description='A Prometheus Exporter for Nagios'"
- "--label=org.opencontainers.image.licenses=MIT"
nfpms:
- id: default
formats:
Expand Down
15 changes: 15 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# taken from https://github.com/prometheus/haproxy_exporter/blob/d4aba878f043fd3ad0bcacd0149e7d75e67c0faa/Dockerfile
ARG ARCH="amd64"
ARG OS="linux"
# they don't tag versions only latest
FROM quay.io/prometheus/busybox-${OS}-${ARCH}:latest
# https://github.com/prometheus/busybox
LABEL maintainer="Will Bollock <[email protected]>"

ARG ARCH="amd64"
ARG OS="linux"
COPY nagios_exporter /bin/nagios_exporter

EXPOSE 9927
USER nobody
ENTRYPOINT [ "/bin/nagios_exporter" ]
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,21 @@ This exporter does not output Nagios check results as Prometheus metrics; it is

## Table of Contents

- [nagios_exporter](#nagios_exporter)
- [nagios\_exporter](#nagios_exporter)
- [Table of Contents](#table-of-contents)
- [Configuration](#configuration)
- [Nagios Core 3/4 support](#nagios-core-34-support)
- [Installation](#installation)
- [Debian/RPM package](#debianrpm-package)
- [Docker](#docker)
- [Binary](#binary)
- [Source](#source)
- [Grafana](#grafana)
- [Troubleshooting](#troubleshooting)
- [NagiosXI](#nagiosxi)
- [Nagios Core 3/4, CheckMK](#nagios-core-34-checkmk)
- [Resources Used](#resources-used)
- [Contributors ✨](#contributors-)

## Configuration

Expand Down Expand Up @@ -98,6 +100,17 @@ wget https://github.com/wbollock/nagios_exporter/releases/download/v{{ version }
{dpkg,rpm} -i prometheus-nagios-exporter_{{ version }}_linux_amd64.{deb,rpm}
```

### Docker

Populate `config.toml` with your `APIKey = <NagiosXIAPIKey>`

```console
docker run \
-v ./config.toml:/etc/prometheus-nagios-exporter/config.toml \
ghcr.io/wbollock/nagios_exporter --\
--nagios.scrape-uri https://<my-tls-url>
```

### Binary

```bash
Expand Down

0 comments on commit 510e122

Please sign in to comment.