AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.
fix(agent): Add check for Linux container support to `is_docker_available`
Reinier van der Leerbca50310f65a
diff --git a/autogpts/autogpt/autogpt/commands/execute_code.py b/autogpts/autogpt/autogpt/commands/execute_code.pyindex 6aaa4b6316..a0ef57179b 100644--- a/autogpts/autogpt/autogpt/commands/execute_code.py+++ b/autogpts/autogpt/autogpt/commands/execute_code.py@@ -44,14 +44,15 @@ def we_are_running_in_a_docker_container() -> bool:def is_docker_available() -> bool:- """Check if Docker is available+ """Check if Docker is available and supports Linux containersReturns:- bool: True if Docker is available, False otherwise"""+ bool: True if Docker is available and supports Linux containers, False otherwise+ """try:client = docker.from_env()- client.ping()- return True+ docker_info = client.info()+ return docker_info["OSType"] == "linux"except Exception:return False