mirror of
https://github.com/status-im/go-watchdog.git
synced 2025-01-22 15:28:49 +00:00
8676adea5c
This commit introduces the cgroup-driven watchdog. It can be initialized by calling watchdog.CgroupDriven(). This watchdog infers the limit from the process' cgroup, which is either derived from /proc/self/cgroup, or from the root cgroup if the PID == 1 (running in a container). Tests have been added/refactored to accommodate running locally and in a Docker container. Certain test cases now must be isolated from one another, to prevent side-effects from dirty go runtimes. A Makefile has been introduced to run all tests.
11 lines
256 B
Docker
11 lines
256 B
Docker
FROM golang:1.15.5
|
|
WORKDIR /watchdog
|
|
COPY . .
|
|
RUN CGO_ENABLED=0 GOOS=linux go test -c -o watchdog.test
|
|
|
|
FROM alpine:latest
|
|
RUN apk --no-cache add ca-certificates
|
|
WORKDIR /root/
|
|
COPY --from=0 /watchdog/watchdog.test .
|
|
CMD ["/root/watchdog.test", "-test.v"]
|