Skip to content

Instantly share code, notes, and snippets.

@foosel

foosel/Dockerfile Secret

Last active Mar 28, 2021
Embed
What would you like to do?
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