Using puppet-agent puppet-agent-1.1.1.239.g3d67503 from nightlies, July 1, 2015, facter 3 fails to produce the expected result for the `virtual` fact in a docker container on a Centos 7 host.
The container returns the `virtual` fact of the host system not that of the container.
Steps to reproduce
Environment:
-
Host: Centos-7-x86_64 vmware vm
-
Docker: Latest version (1.6.2), installed from get.docker.com
-
Docker Container: Centos 7
-
Facter: Version 3.0.1 (commit 97fcfb6395f3aba974d7ea103d516621942889f4), installed via nightly build of puppet-agent
Install docker on host and start docker service
[root@j1vqpt6h9xltrri ~]# curl https://get.docker.com/ | sh
|
[root@j1vqpt6h9xltrri ~]# docker --version
|
Docker version 1.6.2, build ba1f6c3/1.6.2
|
[root@j1vqpt6h9xltrri ~]# service docker start
|
Redirecting to /bin/systemctl start docker.service
|
Create Centos 7 container with puppet-agent
[root@j1vqpt6h9xltrri ~]# mkdir centos7-puppet-agent-g3d67503
|
[root@j1vqpt6h9xltrri ~]# vi centos7-puppet-agent-g3d67503/Dockerfile
|
[root@j1vqpt6h9xltrri ~]# cat centos7-puppet-agent-g3d67503/Dockerfile
|
FROM centos:7
|
RUN yum install -y dmidecode
|
RUN rpm -ivh http://nightlies.puppetlabs.com/puppet-agent/3d67503e963f4f09b26fe2800fb13670b5f748a2/repos/el/7/PC1/x86_64/puppet-agent-1.1.1.239.g3d67503-1.el7.x86_64.rpm
|
[root@j1vqpt6h9xltrri ~]# docker build -t centos7-puppet-agent-g3d67503 centos7-puppet-agent-g3d67503
|
Validate `virtual` fact on container
[root@j1vqpt6h9xltrri ~]# docker run -it --rm centos7-puppet-agent-g3d67503 /opt/puppetlabs/bin/facter --version
|
3.0.1 (commit 97fcfb6395f3aba974d7ea103d516621942889f4)
|
[root@j1vqpt6h9xltrri ~]# docker run -it --rm centos7-puppet-agent-g3d67503 /opt/puppetlabs/bin/facter is_virtual virtual
|
is_virtual => true
|
virtual => vmware
|
Expected Result
[root@j1vqpt6h9xltrri ~]# docker run -it --rm centos7-puppet-agent-g3d67503 /opt/puppetlabs/bin/facter is_virtual virtual
|
is_virtual => true
|
virtual => docker
|
Actual result
[root@j1vqpt6h9xltrri ~]# docker run -it --rm centos7-puppet-agent-g3d67503 /opt/puppetlabs/bin/facter is_virtual virtual
|
is_virtual => true
|
virtual => vmware
|
|