From 28f7cb0d630a57522131b9a2d005b666898ae8e9 Mon Sep 17 00:00:00 2001 From: shirou Date: Sun, 11 Mar 2018 13:22:13 +0900 Subject: [PATCH] [host] linux: use uptime even if docker guest. --- host/host_linux.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/host/host_linux.go b/host/host_linux.go index 5324258..8f6e02f 100644 --- a/host/host_linux.go +++ b/host/host_linux.go @@ -113,6 +113,9 @@ func BootTimeWithContext(ctx context.Context) (uint64, error) { if system == "lxc" && role == "guest" { // if lxc, /proc/uptime is used. statFile = "uptime" + } else if system == "docker" && role == "guest" { + // also docker, guest + statFile = "uptime" } filename := common.HostProc(statFile)