Skip to content

Commit 8a62eb0

Browse files
thequailmanTwiN
andauthored
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 <[email protected]>
1 parent c9c2639 commit 8a62eb0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Dockerfile

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
# Build the go application into a binary
22
FROM golang:alpine AS builder
3-
RUN apk --update add ca-certificates
3+
RUN apk --update add ca-certificates libcap-setcap
44
WORKDIR /app
55
COPY . ./
66
RUN go mod tidy
77
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o gatus .
8+
RUN setcap CAP_NET_RAW+ep gatus
89

910
# Run Tests inside docker image if you don't have a configured go environment
1011
#RUN apk update && apk add --virtual build-dependencies build-base gcc

0 commit comments

Comments
 (0)