On 19/12/2025 10:27 pm, Nathan Chancellor wrote:
On Thu, Dec 18, 2025 at 01:49:52PM +0100, Guillaume Tucker wrote:
...
+    def __init__(self, args, logger):
Adding something like

     self._args = [
         '--rm',
         '--tty',
         '--volume', f'{os.getcwd()}:/src',
         '--workdir', '/src',
     ]

here then adding an __init__() in the subclasses to append the runtime
specific arguments would allow _do_run() to be moved into
ContainerRuntime(). Otherwise, this looks pretty good and extensible.

Yes, I left these very similar parts as-is on purpose to make it very
clear what the command line arguments are for each container runtime.
It's a good idea to refactor this though as you mention, and I'll add
a debug log message to print the command line instead.

I'm also anticipating that other runtimes will be quite different,
Podman and Docker just so happen to have many options in common.
Things like runc or containerd are very different beasts so I don't
want to over-generalise.  But this is straightforward enough for now.

So I'll rework this a bit in a v3.

Cheers,
Guillaume

Reply via email to