mirror of
https://github.com/docker/docker-bench-security.git
synced 2025-01-19 00:32:34 +01:00
consistent labeling
Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>
This commit is contained in:
parent
d9bb6ce936
commit
2dbfdd112f
2 changed files with 3 additions and 3 deletions
|
@ -38,7 +38,7 @@ docker run -it --net host --pid host --cap-add audit_control \
|
||||||
-v /var/lib:/var/lib \
|
-v /var/lib:/var/lib \
|
||||||
-v /var/run/docker.sock:/var/run/docker.sock \
|
-v /var/run/docker.sock:/var/run/docker.sock \
|
||||||
-v /usr/lib/systemd:/usr/lib/systemd \
|
-v /usr/lib/systemd:/usr/lib/systemd \
|
||||||
-v /etc:/etc --label security-benchmark \
|
-v /etc:/etc --label docker-bench-security \
|
||||||
docker-bench-security
|
docker-bench-security
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -73,11 +73,11 @@ done
|
||||||
main () {
|
main () {
|
||||||
# List all running containers
|
# List all running containers
|
||||||
containers=$(docker ps -q)
|
containers=$(docker ps -q)
|
||||||
# If there is a container with label docker-bench, memorize it:
|
# If there is a container with label docker-bench-security, memorize it:
|
||||||
benchcont="nil"
|
benchcont="nil"
|
||||||
for c in $containers; do
|
for c in $containers; do
|
||||||
labels=$(docker inspect --format '{{ .Config.Labels }}' "$c")
|
labels=$(docker inspect --format '{{ .Config.Labels }}' "$c")
|
||||||
contains "$labels" "docker-bench" && benchcont="$c"
|
contains "$labels" "docker-bench-security" && benchcont="$c"
|
||||||
done
|
done
|
||||||
# List all running containers except docker-bench
|
# List all running containers except docker-bench
|
||||||
containers=$(docker ps -q | grep -v "$benchcont")
|
containers=$(docker ps -q | grep -v "$benchcont")
|
||||||
|
|
Loading…
Reference in a new issue