This project is no longer being developed and has limited support. In the near future this repository will be fully deprecated. Please consider using other OneView projects, such as Terraform and Ansible Collection
# docker run -it -v $(pwd)/:/puppet puppet-oneview-ruby /bin/bash
root@d4ea7ea74178:/puppet# touch test
touch: cannot touch 'test': Permission denied
Adding the :z on the volume mount
docker run -it -v $(pwd)/:/puppet:z puppet-oneview-ruby /bin/bash
root@d4ea7ea74178:/puppet# touch test
#
# bundle install
Fetching https://github.com/HewlettPackard/oneview-sdk-ruby.git
Fetching gem metadata from http://rubygems.org/.......
Fetching version metadata from http://rubygems.org/.
Resolving dependencies...
Using rake 12.0.0
Using ast 2.3.0
.
Now the puppet run works...
# docker/test.sh.example ethernet_network.pp
Debug: Runtime environment: puppet_version=4.9.2, ruby_version=2.2.0, run_mode=user, default_encoding=US-ASCII
Debug: Evicting cache entry for environment 'production'
Debug: Caching environment 'production' (ttl = 0 sec)
Debug: Loading external facts from /opt/puppetlabs/puppet/cache/facts.d
Debug: Facter: Found no suitable resolves of 1 for ec2_metadata
Debug: Facter: value for ec2_metadata is still nil
Scenario/Intent
Trying to create the docker container using the Dockerfile as suggested by the documentation to get started quickly fails.
The docker build completes without errors but since CentOS has selinux enabledit fails with errors when trying to do a puppet run.
Environment Details
Steps to Reproduce
Build the image
# docker/build.sh.example
Try a puppet run... which fails due to non of the gems have been install
The suggested volume mount gets into selinux context missing http://stackoverflow.com/questions/24288616/permission-denied-on-accessing-host-directory-in-docker
Adding the :z on the volume mount
Now the puppet run works...
Not sure if this is related to a bug ... https://github.com/docker/compose/issues/2535 But that’s a compose issue I guess.
So if this is something related to this project, I'm not sure.
Maybe the documentation could be updated to make it easier for people using distributions with selinux?