mirror of
https://github.com/inspec/inspec
synced 2024-11-14 17:07:09 +00:00
Merge pull request #649 from chef/chris-rock/explain-inspec-docker
add usage instructions for inspec container
This commit is contained in:
commit
dfdae3474d
1 changed files with 25 additions and 0 deletions
25
README.md
25
README.md
|
@ -51,6 +51,31 @@ InSpec requires Ruby ( >1.9 ).
|
|||
gem install inspec
|
||||
```
|
||||
|
||||
### Usage via Docker
|
||||
|
||||
Download the image and define an alias for convenience:
|
||||
|
||||
```
|
||||
docker pull chef/inspec
|
||||
alias inspec='docker run -it --rm -v $(pwd):/share chef/inspec'
|
||||
```
|
||||
|
||||
If you call inspec from cli, it automatically mounts the current directory into the work directory. Therefore you can easily use local tests and key files. Note: Only files in the current directory are available to the container.
|
||||
|
||||
```
|
||||
$ ls -1
|
||||
vagrant
|
||||
test.rb
|
||||
|
||||
|
||||
$ inspec exec test.rb -t ssh://root@192.168.64.2:11022 -i vagrant
|
||||
..
|
||||
|
||||
Finished in 0.04321 seconds (files took 0.54917 seconds to load)
|
||||
2 examples, 0 failures
|
||||
```
|
||||
|
||||
|
||||
### Install it from source
|
||||
|
||||
That requires [bundler](http://bundler.io/):
|
||||
|
|
Loading…
Reference in a new issue