mirror of
https://github.com/docker/docker-bench-security.git
synced 2024-11-01 08:31:44 +01:00
label rule for 1.8
Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>
This commit is contained in:
parent
887f5a4e34
commit
815b369237
2 changed files with 3 additions and 3 deletions
|
@ -18,7 +18,7 @@ docker run -it --net host --pid host --cap-add audit_control \
|
|||
-v /var/lib:/var/lib \
|
||||
-v /var/run/docker.sock:/var/run/docker.sock \
|
||||
-v /usr/lib/systemd:/usr/lib/systemd \
|
||||
-v /etc:/etc --label docker-bench-security \
|
||||
-v /etc:/etc --label docker_bench_security \
|
||||
diogomonica/docker-bench-security
|
||||
```
|
||||
|
||||
|
@ -38,7 +38,7 @@ docker run -it --net host --pid host --cap-add audit_control \
|
|||
-v /var/lib:/var/lib \
|
||||
-v /var/run/docker.sock:/var/run/docker.sock \
|
||||
-v /usr/lib/systemd:/usr/lib/systemd \
|
||||
-v /etc:/etc --label docker-bench-security \
|
||||
-v /etc:/etc --label docker_bench_security \
|
||||
docker-bench-security
|
||||
```
|
||||
|
||||
|
|
|
@ -79,7 +79,7 @@ main () {
|
|||
benchcont="nil"
|
||||
for c in $containers; do
|
||||
labels=$(docker inspect --format '{{ .Config.Labels }}' "$c")
|
||||
contains "$labels" "docker-bench-security" && benchcont="$c"
|
||||
contains "$labels" "docker_bench_security" && benchcont="$c"
|
||||
done
|
||||
# List all running containers except docker-bench (use names to improve readability in logs)
|
||||
containers=$(docker ps | sed '1d' | awk '{print $NF}' | grep -v "$benchcont")
|
||||
|
|
Loading…
Reference in a new issue