mirror of
https://github.com/TwiN/gatus.git
synced 2025-06-25 12:12:29 +02:00
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 <twin@linux.com>
This commit is contained in:
parent
c9c2639f67
commit
8a62eb0dcc
@ -1,10 +1,11 @@
|
|||||||
# Build the go application into a binary
|
# Build the go application into a binary
|
||||||
FROM golang:alpine AS builder
|
FROM golang:alpine AS builder
|
||||||
RUN apk --update add ca-certificates
|
RUN apk --update add ca-certificates libcap-setcap
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY . ./
|
COPY . ./
|
||||||
RUN go mod tidy
|
RUN go mod tidy
|
||||||
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o gatus .
|
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 Tests inside docker image if you don't have a configured go environment
|
||||||
#RUN apk update && apk add --virtual build-dependencies build-base gcc
|
#RUN apk update && apk add --virtual build-dependencies build-base gcc
|
||||||
|
Loading…
x
Reference in New Issue
Block a user