Details
-
Bug
-
Status: Resolved
-
Normal
-
Resolution: Fixed
-
None
Description
When getting the uptime inside a docker container, the kernel will report the host uptime. In order to get the container uptime, we should get the uptime of PID 1, that is the process that starts when the container is starting.
To get the running time of pid 1 inside the container, we useĀ
ps -o etime= -p "1" |