From 8a62eb0dcc763bf7f92814f94cd8689f7e89b42e Mon Sep 17 00:00:00 2001 From: Mike McRill <11181019+thequailman@users.noreply.github.com> Date: Tue, 1 Apr 2025 18:05:27 -0500 Subject: [PATCH] fix(client): Use libcap to fix icmp not working in containers as non-root (#1056) Fix ping monitors not working in containers as non-root Co-authored-by: TwiN --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 8e55ef6b..2e5bb24e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,11 @@ # Build the go application into a binary FROM golang:alpine AS builder -RUN apk --update add ca-certificates +RUN apk --update add ca-certificates libcap-setcap WORKDIR /app COPY . ./ RUN go mod tidy RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o gatus . +RUN setcap CAP_NET_RAW+ep gatus # Run Tests inside docker image if you don't have a configured go environment #RUN apk update && apk add --virtual build-dependencies build-base gcc