Closed jsa5593 closed 4 years ago
@jsa5593 and @rbclark please review the code factor issues to see if we can resolve them
Also, we need to add usage examples in the README. How would folks actually use this and a couple of examples?
I've been thinking about this a bit more and we may need to build the gem inside of the Dockerfile in order to silence the CodeFactor warning. I tried to test this locally and was running into a weird error which ended up being https://github.com/mitre/inspec_tools/pull/182. Once that is merged it should be easily possible to build inside the container using gem build
and then gem install
the built gem.
There are multiple ways we can except the Chef license. The easiest way is to set an environment variable in the container with Chef license accept. In the build process we could always invoke in spec and pass It accept which would create the needed files in the file system for the acceptance of the license. We could also just Generate the license acceptance manually as per the documentation when you Google accepting the Chef license. Which ever one keeps the container the smallest is probably the best path.
There are multiple ways we can except the Chef license. The easiest way is to set an environment variable in the container with Chef license accept. In the build process we could always invoke in spec and pass It accept which would create the needed files in the file system for the acceptance of the license. We could also just Generate the license acceptance manually as per the documentation when you Google accepting the Chef license. Which ever one keeps the container the smallest is probably the best path.
It seemed to me that having the user do it made sense so that we aren't just silently accepting a license on their behalf. If we do want to silently accept it on their behalf we can always just run inspec --chef-license=accept
as a build step.
They are just following the directions so let’s just build it in.
The Dockerfile installs inspec_tools and can be run by running the container with specifying -v
pwd
:/share Build:docker build -t "container name" .
Run:docker run -v
pwd:/share -e CHEF_LICENSE=accept "container name" "command"