From 94a505467870f6de20e6ec765f7d5cd28dd4a46a Mon Sep 17 00:00:00 2001 From: Sonu Saha <98935583+ahasunos@users.noreply.github.com> Date: Wed, 30 Nov 2022 05:07:44 +0530 Subject: [PATCH] Update readme for usage via Docker (CFINSPEC-516) (#6329) * DOCS: Update readme for usage via Docker (CFINSPEC-516) Signed-off-by: Sonu Saha * DOCS: Explain updated readme (CFINSPEC-516) Signed-off-by: Sonu Saha Signed-off-by: Sonu Saha --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index a3b5242af..611abe0ab 100644 --- a/README.md +++ b/README.md @@ -133,6 +133,14 @@ Finished in 0.04321 seconds (files took 0.54917 seconds to load) 2 examples, 0 failures ``` +To scan the docker containers running on the host using the containerized InSpec, we need to bind-mount the Unix socket `/var/run/docker.sock` from the host machine to the InSpec Container. + +``` +docker pull chef/inspec +function inspec { docker run -it --rm -v $(pwd):/share -v /var/run/docker.sock:/var/run/docker.sock chef/inspec "$@"; } +``` +`/var/run/docker.sock` is the Unix socket the Docker daemon listens on by default. + ### Install it from source