Uploaded image for project: 'Facter'
  1. Facter
  2. FACT-2737

facter uptime shows host uptime inside docker container

    XMLWordPrintable

Details

    • Night's Watch
    • 2
    • ghost-19
    • Needs Assessment
    • Bug Fix
    • Hide
      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"
      Show
      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"
    • Needs Assessment

    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"
      

      Attachments

        Activity

          People

            bogdan.irimie Bogdan Irimie
            florin.dragos Florin Dragos
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Zendesk Support