Skip to content
HookPulse

Monitor Docker container jobs with HookPulse

The container sends its exit status to HookPulse when the job ends. Pass the check-in URL as an environment variable.

Updated

1Create the monitor

Add a routine named container-backup and set how often the job runs. Its page shows the check-in URL: use it in place of https://hookpulse.net/in/YOUR_ID.

2End the container command with the check-in

The image needs curl. $? is the exit status of the job.

FROM alpine:3.20
RUN apk add --no-cache curl
COPY backup.sh /usr/local/bin/backup.sh
CMD ["/bin/sh", "-c", "backup.sh; curl -fsS -m 10 --retry 3 \"$HOOKPULSE_URL/$?\""]

3Run the container with the URL

Run it from cron, a scheduler or your orchestrator.

docker run --rm -e HOOKPULSE_URL="https://hookpulse.net/in/YOUR_ID" my-backup

4Run it once

Run the container once. The routine shows the first check-in. From then on, a missed or failed run sends the alert.