From 6c9bb49fb4c7356245cd0c7442361e6814ccc6b2 Mon Sep 17 00:00:00 2001 From: Dom Sekotill Date: Fri, 3 Mar 2023 01:16:55 +0000 Subject: [PATCH] Add auto removal flag to containers --- behave_utils/docker.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/behave_utils/docker.py b/behave_utils/docker.py index 609506f..d9d68af 100644 --- a/behave_utils/docker.py +++ b/behave_utils/docker.py @@ -1,4 +1,4 @@ -# Copyright 2021-2022 Dominik Sekotill +# Copyright 2021-2023 Dominik Sekotill # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this @@ -342,7 +342,10 @@ class Container(Item): else: opts.append(b"--network=none") - self.cid = docker_output(b"container", b"create", *opts, self.image.iid, *self.cmd) + self.cid = docker_output( + b"container", b"create", "--rm", + *opts, self.image.iid, *self.cmd, + ) assert self.cid # Disconnect the "none" network specified as the starting network -- GitLab