From 551db1423d171bd1a478ecf76ea966d419fb6d0c Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Jul 19 2017 12:28:59 +0000 Subject: inventory: Use 'docker rm' when cleaning up Certain older versions of docker do not like specifying both --detach and --rm together on the run command line. So separate out this step during cleanup. --- diff --git a/inventory/standard-inventory-docker b/inventory/standard-inventory-docker index 8f3b39d..b8854f2 100755 --- a/inventory/standard-inventory-docker +++ b/inventory/standard-inventory-docker @@ -61,7 +61,7 @@ def host(image): # And launch the actual container cmd = [ - "/usr/bin/docker", "run", "--rm", "--detach", "--cidfile={0}".format(cidfile), + "/usr/bin/docker", "run", "--detach", "--cidfile={0}".format(cidfile), "--entrypoint=/bin/sh", image, "-c", "sleep 1000000" ] @@ -127,7 +127,8 @@ def host(image): # Kill the container try: - subprocess.call(["/usr/bin/docker", "kill", name ]) + subprocess.call(["/usr/bin/docker", "kill", name ], stdout=null) + subprocess.call(["/usr/bin/docker", "rm", "-f", name ], stdout=null) except OSError: pass