When running in a Docker container, facter incorrectly reports the OS.
To reproduce this, start a docker container with the "ubuntu" image, install Facter from the Puppet repository, run "puppet os" and notice it is reported as "Debian".
We currently rely on the lsb-release package (specifically the lsb_release command) to identify various Debian derivatives. Probably we need to switch to the os-release file, since that appears to have filtered into most modern versions of various distros at this point.
For now, you should be able to install the lsb-release package in your container images to get Facter to behave correctly.
This breaks facter v4 in debian based docker images with the error below. After installed lsb-release package, it works. But at least ruby docker image, which is based on debian, doesn't work by default.
$ facterfacter#<Thread:0x000055965be434e0@/usr/local/bundle/gems/facter-4.0.11/lib/framework/core/fact/internal/internal_fact_manager.rb:23 run> terminated with exception (report_on_exception is true):Traceback (most recent call last): 2: from /usr/local/bundle/gems/facter-4.0.11/lib/framework/core/fact/internal/internal_fact_manager.rb:25:in `block (2 levels) in start_threads' 1: from /usr/local/bundle/gems/facter-4.0.11/lib/framework/core/fact/internal/core_fact.rb:12:in `create'/usr/local/bundle/gems/facter-4.0.11/lib/facts/debian/os/release.rb:12:in `call_the_resolver': undefined method `split'for nil:NilClass (NoMethodError)#<Thread:0x000055965be432b0@/usr/local/bundle/gems/facter-4.0.11/lib/framework/core/fact/internal/internal_fact_manager.rb:23 run> terminated with exception (report_on_exception is true):Traceback (most recent call last): 2: from /usr/local/bundle/gems/facter-4.0.11/lib/framework/core/fact/internal/internal_fact_manager.rb:25:in `block (2 levels) in start_threads' 1: from /usr/local/bundle/gems/facter-4.0.11/lib/framework/core/fact/internal/core_fact.rb:12:in `create'/usr/local/bundle/gems/facter-4.0.11/lib/facts/debian/os/release.rb:12:in `call_the_resolver': undefined method `split'for nil:NilClass (NoMethodError)#<Thread:0x000055965be433c8@/usr/local/bundle/gems/facter-4.0.11/lib/framework/core/fact/internal/internal_fact_manager.rb:23 run> terminated with exception (report_on_exception is true):Traceback (most recent call last): 2: from /usr/local/bundle/gems/facter-4.0.11/lib/framework/core/fact/internal/internal_fact_manager.rb:25:in `block (2 levels) in start_threads' 1: from /usr/local/bundle/gems/facter-4.0.11/lib/framework/core/fact/internal/core_fact.rb:12:in `create'/usr/local/bundle/gems/facter-4.0.11/lib/facts/debian/os/release.rb:12:in `call_the_resolver': undefined method `split'for nil:NilClass (NoMethodError)Traceback (most recent call last): 2: from /usr/local/bundle/gems/facter-4.0.11/lib/framework/core/fact/internal/internal_fact_manager.rb:25:in `block (2 levels) in start_threads' 1: from /usr/local/bundle/gems/facter-4.0.11/lib/framework/core/fact/internal/core_fact.rb:12:in `create'/usr/local/bundle/gems/facter-4.0.11/lib/facts/debian/os/release.rb:12:in `call_the_resolver': undefined method `split'for nil:NilClass (NoMethodError)