Skip to content

Instantly share code, notes, and snippets.

@foosel
Last active September 4, 2022 18:03
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save foosel/46804306d510d79f14117f95ed64b877 to your computer and use it in GitHub Desktop.
Save foosel/46804306d510d79f14117f95ed64b877 to your computer and use it in GitHub Desktop.
Simple Dockerfile, compose and config example for an infping setup using https://github.com/nickvanw/infping

Build and fire up the container stack with docker-compose up --build -d.

Configuration can be done by mounting an infping.yaml as /config/infping.yaml into the container, similar to this:

influx: 
  host: <influxdb host>
  port: <influxdb port>
  user: <influxdb user>
  pass: <influxdb passwort>
  secure: <true or false>
  db: <influxdb database>

fping: 
  backoff: 1
  retries: 0
  tos: 0
  summary: 60
  period: 1000
  custom: {}

hosts:
  hosts:
    # Google DNS
    - 8.8.8.8
    - 8.8.4.4

    # Cloudflare
    - 1.1.1.1
    - 1.0.0.1

    # QuadNine
    - 9.9.9.9

    # [...]

See the infping README for a documentation of the config format.

version: '2.1'
services:
infping:
build: .
volumes:
- /path/to/infping/config:/config
FROM golang:alpine AS build-env
RUN apk --update add git && \
git clone https://github.com/nickvanw/infping.git $GOPATH/src/github.com/nickvanw/infping && \
cd $GOPATH/src/github.com/nickvanw/infping && \
go get -v && go build -o /infping
# final stage
FROM alpine
COPY --from=build-env /infping /
RUN apk add --no-cache ca-certificates fping
ENTRYPOINT ["/infping"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment