diff --git a/supervisor/docker/homeassistant.py b/supervisor/docker/homeassistant.py index 738772b12..e9085de95 100644 --- a/supervisor/docker/homeassistant.py +++ b/supervisor/docker/homeassistant.py @@ -213,9 +213,6 @@ class DockerHomeAssistant(DockerInterface): privileged=True, init=True, entrypoint=[], - detach=True, - stdout=True, - stderr=True, mounts=[ Mount( type=MountType.BIND.value, diff --git a/supervisor/docker/manager.py b/supervisor/docker/manager.py index fc4461c67..0c00b4c5b 100644 --- a/supervisor/docker/manager.py +++ b/supervisor/docker/manager.py @@ -313,6 +313,7 @@ class DockerAPI: container = self.docker.containers.run( image_with_tag, command=command, + detach=True, network=self.network.name, use_config_proxy=False, **kwargs, @@ -331,7 +332,7 @@ class DockerAPI: with suppress(docker_errors.DockerException, requests.RequestException): container.remove(force=True, v=True) - return CommandReturn(result.get("StatusCode"), output) + return CommandReturn(result["StatusCode"], output) def repair(self) -> None: """Repair local docker overlayfs2 issues.""" diff --git a/tests/docker/test_manager.py b/tests/docker/test_manager.py index c06c2b3bc..cd6e2b4a4 100644 --- a/tests/docker/test_manager.py +++ b/tests/docker/test_manager.py @@ -34,6 +34,7 @@ async def test_run_command_success(docker: DockerAPI): docker.docker.containers.run.assert_called_once_with( "alpine:3.18", command="echo hello", + detach=True, network=docker.network.name, use_config_proxy=False, stdout=True, @@ -66,6 +67,7 @@ async def test_run_command_with_defaults(docker: DockerAPI): docker.docker.containers.run.assert_called_once_with( "ubuntu:latest", # default tag command=None, # default command + detach=True, network=docker.network.name, use_config_proxy=False, )