From 11efdaa331e95e9ec27e75a5b30fb1be27d0633a Mon Sep 17 00:00:00 2001 From: k2safe Date: Sun, 1 Nov 2026 19:11:47 +0800 Subject: [PATCH] fix: bind local compose builds to the active Docker context --- scripts/orbit-local.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/orbit-local.py b/scripts/orbit-local.py index 9b2dd93..23cd3c1 100755 --- a/scripts/orbit-local.py +++ b/scripts/orbit-local.py @@ -44,9 +44,9 @@ def compose(*args, **kwargs): env.update(ORBIT_LOCAL_DIRECTORY=str(PRIVATE), ORBIT_LOCAL_USER=f'{os.getuid()}:{os.getgid()}') # 本地环境使用 Docker 自带构建器,不占用用户选中的跨平台构建器。 - env.update(BUILDX_BUILDER=subprocess.check_output( - ['docker', 'context', 'show'], text=True).strip(), COMPOSE_BAKE='false') - command = ['docker', 'compose', '--project-name', 'orbit-test', + docker_context = subprocess.check_output(['docker', 'context', 'show'], text=True).strip() + env.update(BUILDX_BUILDER=docker_context, COMPOSE_BAKE='false') + command = ['docker', '--context', docker_context, 'compose', '--project-name', 'orbit-test', '--env-file', str(ENV_FILE), '-f', str(ROOT / 'deploy/docker-compose.yml'), '-f', str(ROOT / 'deploy/local/compose.yml'), *args] return subprocess.run(command, cwd=ROOT, env=env, check=True, **kwargs)