Verified Commit 69073a87 authored by Dom Sekotill's avatar Dom Sekotill
Browse files

Use absolute path for Docker executable

This solves a bug where the executable search paths list was
deallocated before shutdown, but cleanup code needed `docker`.
parent f3b56ed6
Loading
Loading
Loading
Loading
+7 −8
Original line number Diff line number Diff line
#  Copyright 2021-2023  Dominik Sekotill <dom.sekotill@kodo.org.uk>
#  Copyright 2021-2024  Dominik Sekotill <dom.sekotill@kodo.org.uk>
#
#  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
@@ -26,6 +26,7 @@ from os import environ
from os import fspath
from pathlib import Path
from secrets import token_hex
from shutil import which
from subprocess import DEVNULL
from subprocess import PIPE
from subprocess import CalledProcessError
@@ -69,13 +70,11 @@ Volumes = MutableSequence[Mount]

IPAddress = Union[ipaddress.IPv4Address, ipaddress.IPv6Address]


try:
	run([b"docker", b"version"], stdout=DEVNULL)
except FileNotFoundError:
match which("docker"):
	case None:
		DOCKER: Argument = DownloadableDocker().get_binary()
else:
	DOCKER = b"docker"
	case str(path):
		DOCKER = Path(path)


def utf8_decode(buffer: bytes) -> str: