File tree 2 files changed +4
-1
lines changed
2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -5,8 +5,9 @@ RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o /go/bin/ping_expo
5
5
6
6
FROM alpine:latest
7
7
ENV CONFIG_FILE "/config/config.yml"
8
- RUN apk --no-cache add ca-certificates
8
+ RUN apk --no-cache add ca-certificates libcap
9
9
WORKDIR /app
10
10
COPY --from=builder /go/bin/ping_exporter .
11
+ RUN setcap cap_net_raw+ep /app/ping_exporter
11
12
CMD ./ping_exporter --config.path $CONFIG_FILE
12
13
EXPOSE 9427
Original file line number Diff line number Diff line change @@ -146,6 +146,8 @@ On Linux systems `CAP_NET_RAW` is required to run `ping_exporter` as unprivilige
146
146
# setcap cap_net_raw+ep /path/to/ping_exporter
147
147
` ` `
148
148
149
+ When run through a rootless Docker implementation on Linux, the flag `--cap-add=CAP_NET_RAW` should be added to the `docker run` invocation.
150
+
149
151
# ## Docker
150
152
151
153
https://hub.docker.com/r/czerwonk/ping_exporter
You can’t perform that action at this time.
0 commit comments