Pass --rm to docker create
authorCarl Hetherington <cth@carlh.net>
Tue, 4 Oct 2022 07:25:47 +0000 (09:25 +0200)
committerCarl Hetherington <cth@carlh.net>
Tue, 4 Oct 2022 07:26:06 +0000 (09:26 +0200)
cdist

diff --git a/cdist b/cdist
index f814ba890075b28a6f9389a755f9434e9e5b0f08..0e1df9f7c9abf6d3942daa4aad6ac7516ed75b1b 100755 (executable)
--- a/cdist
+++ b/cdist
@@ -544,7 +544,8 @@ class DockerTarget(Target):
         if self.privileged:
             opts += '--privileged=true '
         if self.ccache:
-            opts += "-e CCACHE_DIR=/ccache/%s-%d --mount source=ccache,target=/ccache" % (self.image, os.getuid())
+            opts += "-e CCACHE_DIR=/ccache/%s-%d --mount source=ccache,target=/ccache " % (self.image, os.getuid())
+        opts += "--rm "
 
         tag = self.image
         if config.has('docker_hub_repository'):