Skip to content

Commit dac28d1

Browse files
committed
metrics: add tini to prevent zombie processes
The metrics-exporter spawns ceph and rbd commands to collect metrics. Without a proper init system, these child processes can become zombies in certain container environments. Adding tini as PID 1 ensures all zombie processes are properly reaped. Signed-off-by: Divyansh Kamboj <[email protected]>
1 parent 6bbca29 commit dac28d1

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

metrics/Dockerfile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,15 @@ RUN go build -ldflags "$LDFLAGS" -tags netgo,osusergo -o metrics-exporter main.g
1414

1515
FROM quay.io/ceph/ceph:v18
1616

17+
# Install tini to reap zombie processes created by ceph/rbd commands
18+
USER root
19+
RUN dnf install -y tini && \
20+
dnf clean all
21+
1722
COPY --from=builder workspace/metrics-exporter /usr/local/bin/metrics-exporter
1823

1924
RUN chmod +x /usr/local/bin/metrics-exporter
2025

2126
USER 2024
2227

23-
ENTRYPOINT ["/usr/local/bin/metrics-exporter"]
28+
ENTRYPOINT ["/usr/bin/tini", "--", "/usr/local/bin/metrics-exporter"]

0 commit comments

Comments
 (0)