label rule for 1.8

Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>
This commit is contained in:
Thomas Sjögren 2015-07-25 14:20:56 +02:00
parent 887f5a4e34
commit 815b369237
2 changed files with 3 additions and 3 deletions

View file

@ -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
```

View file

@ -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")