Docker Image that polls a configurable endpoint continuously, and logs the result to the console
139
Source Code: https://github.com/MrGazdag/docker-endpoint-poller
A lightweight Docker image that continuously polls an HTTP endpoint and writes the result to standard output.
The container is configured through environment variables:
| Variable | Description | Default |
|---|---|---|
URL | Endpoint to poll | https://httpbin.org/uuid |
INTERVAL | Delay between requests (seconds) | 5 |
CURL_OPTIONS | Additional options passed directly to curl | (empty) |
docker run --rm -e URL=http://httpbin.org/uuid -e INTERVAL=2 mrgazdag/endpoint-poller
docker run --rm -e URL=http://httpbin.org/status/500 -e INTERVAL=2 -e CURL_OPTIONS=-sSf mrgazdag/endpoint-poller
Successful requests:
Requesting: http://httpbin.org/uuid
{
"uuid": "d5d5f6ef-9d97-4d6e-a6c5-2fefcf3b0c49"
}
Requesting: http://httpbin.org/uuid
{
"uuid": "9d0c4b2d-2a58-4f5b-a841-c40c0f14c35d"
}
Failed requests:
Requesting: http://does-not-exist
curl: (6) Could not resolve host: does-not-exist
Requesting: http://httpbin/status/500
Content type
Image
Digest
sha256:5ce0f5dc3…
Size
10.1 MB
Last updated
3 months ago
docker pull mrgazdag/endpoint-poller