Merge pull request #454 from Constantin07/do_not_leave_dangling_container_after_run

Remove container after run.
This commit is contained in:
Thomas Sjögren 2020-11-18 09:22:08 +00:00 committed by GitHub
commit ca0db8898f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -21,7 +21,7 @@ The easiest way to run your hosts against the Docker Bench for Security is by
running our pre-built container: running our pre-built container:
```sh ```sh
docker run -it --net host --pid host --userns host --cap-add audit_control \ docker run --rm --net host --pid host --userns host --cap-add audit_control \
-e DOCKER_CONTENT_TRUST=$DOCKER_CONTENT_TRUST \ -e DOCKER_CONTENT_TRUST=$DOCKER_CONTENT_TRUST \
-v /etc:/etc:ro \ -v /etc:/etc:ro \
-v /usr/bin/containerd:/usr/bin/containerd:ro \ -v /usr/bin/containerd:/usr/bin/containerd:ro \
@ -40,7 +40,7 @@ Some examples are:
binaries. binaries.
```sh ```sh
docker run -it --net host --pid host --userns host --cap-add audit_control \ docker run --rm --net host --pid host --userns host --cap-add audit_control \
-e DOCKER_CONTENT_TRUST=$DOCKER_CONTENT_TRUST \ -e DOCKER_CONTENT_TRUST=$DOCKER_CONTENT_TRUST \
-v /etc:/etc \ -v /etc:/etc \
-v /var/lib:/var/lib:ro \ -v /var/lib:/var/lib:ro \
@ -53,7 +53,7 @@ docker run -it --net host --pid host --userns host --cap-add audit_control \
`/lib/systemd/system` folder by default. `/lib/systemd/system` folder by default.
```sh ```sh
docker run -it --net host --pid host --userns host --cap-add audit_control \ docker run --rm --net host --pid host --userns host --cap-add audit_control \
-e DOCKER_CONTENT_TRUST=$DOCKER_CONTENT_TRUST \ -e DOCKER_CONTENT_TRUST=$DOCKER_CONTENT_TRUST \
-v /etc:/etc:ro \ -v /etc:/etc:ro \
-v /lib/systemd/system:/lib/systemd/system:ro \ -v /lib/systemd/system:/lib/systemd/system:ro \