From 1fa1b90c30b2c7efc22ce0f8ff94d6f0686c139e Mon Sep 17 00:00:00 2001 From: deeplow Date: Fri, 26 Aug 2022 10:00:02 +0100 Subject: [PATCH] remove container after use The containers and their respective volumes where not being deleted. By adding `--rm` to the `podman run` it now removes the containers after use along with anonymous (unnamed) volumes [1]. The same happens in docker [2]. Fixes #196 [1]: https://docs.podman.io/en/latest/markdown/podman-run.1.html#volume-v-source-volume-host-dir-container-dir-options [2]: https://docs.docker.com/storage/volumes/#remove-volumes --- dangerzone/container.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dangerzone/container.py b/dangerzone/container.py index 97a54e75f..193d109b9 100644 --- a/dangerzone/container.py +++ b/dangerzone/container.py @@ -75,11 +75,14 @@ def exec_container( security_args += ["--cap-drop", "all"] user_args = ["-u", "dangerzone"] + prevent_leakage_args = ["--rm"] + args = ( ["run", "--network", "none"] + platform_args + user_args + security_args + + prevent_leakage_args + extra_args + [container_name] + command