mirror of
https://github.com/inspec/inspec
synced 2024-11-10 07:04:15 +00:00
Updates README to use function instead of alias (#2679)
I really liked the inclusion of the alias for the docker run version of installing inspec. The instructions tried to make it clear that when you create the alias that it was for only your current directory but it sounded more like your current working directory wherever you were so I thought that it would be better to actually make that work. By changing it to a function you now can delay the processing of the $(pwd) subshell so that it will mount your current working directory when you run it. This makes it really easy to use the InSpec CLI and the installation this way is on par with the other ways. Signed-off-by: Franklin Webber <franklin@chef.io>
This commit is contained in:
parent
30ff651cbf
commit
58958d5756
1 changed files with 3 additions and 4 deletions
|
@ -84,21 +84,20 @@ gem install inspec
|
|||
|
||||
### Usage via Docker
|
||||
|
||||
Download the image and define an alias for convenience:
|
||||
Download the image and define a function for convenience:
|
||||
|
||||
```
|
||||
docker pull chef/inspec
|
||||
alias inspec='docker run -it --rm -v $(pwd):/share chef/inspec'
|
||||
function 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.
|
||||
If you call `inspec` from your shell, it automatically mounts the current directory into the Docker container. Therefore you can easily use local tests and key files. Note: Only files in the current directory and sub-directories are available within the container.
|
||||
|
||||
```
|
||||
$ ls -1
|
||||
vagrant
|
||||
test.rb
|
||||
|
||||
|
||||
$ inspec exec test.rb -t ssh://root@192.168.64.2:11022 -i vagrant
|
||||
..
|
||||
|
||||
|
|
Loading…
Reference in a new issue