# File lib/facter/util/virtual.rb, line 178 def self.docker? path = Pathname.new('/proc/1/cgroup') return false unless path.readable? begin in_docker = path.readlines.any? {|l| l.split(":")[2].to_s.include? '/docker' } rescue Errno::EPERM => exc # This can fail under OpenVZ, just like in .lxc? return false end return true if in_docker return false end