From 3dd4184193df244c13f873deaf8db2202f3573a5 Mon Sep 17 00:00:00 2001 From: Dale Arbogast Date: Thu, 19 Feb 2026 16:44:01 -0500 Subject: [PATCH] fix: busybox static link detection on Alpine/musl On musl-based systems (Alpine), ldd returns exit code 0 for static binaries, unlike glibc which returns 1. This causes install_busybox() to reject all busybox binaries as "dynamically linked" on Alpine. Fix by also accepting binaries whose executable name contains "static" (i.e. busybox-static, busybox.static), which are the first two candidates checked by the function. The generic "busybox" fallback still relies on the ldd return code check. --- gns3server/compute/docker/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gns3server/compute/docker/__init__.py b/gns3server/compute/docker/__init__.py index 696646ade..a441af830 100644 --- a/gns3server/compute/docker/__init__.py +++ b/gns3server/compute/docker/__init__.py @@ -79,8 +79,10 @@ class Docker(BaseManager): stderr=asyncio.subprocess.DEVNULL ) stdout, _ = await proc.communicate() - if proc.returncode == 1: + if proc.returncode == 1 or "static" in busybox_exec: # ldd returns 1 if the file is not a dynamic executable + # on Alpine/musl, ldd returns 0 even for static binaries, + # so also trust binaries named busybox-static or busybox.static log.info(f"Installing busybox from '{busybox_path}' to '{dst_busybox}'") shutil.copy2(busybox_path, dst_busybox, follow_symlinks=True) return