Skip to content

Commit 02180df

Browse files
BohdanVilischukwaleedlatif1
authored andcommitted
fix(setup): don't let an installed OrbStack override an explicit Docker Desktop context
macDockerApp() fell through to the OrbStack.app existence check whenever docker context show returned anything other than "orbstack" — including a known, explicit context like "desktop-linux". With both apps installed but Docker Desktop active and stopped, this launched OrbStack while daemonUp() kept polling Docker Desktop's socket, timing out with OrbStack-flavored guidance for a Docker Desktop problem. The path fallback now only runs when the context command gives no answer at all (null); any resolved context is trusted outright. Flagged identically by Greptile and Cursor Bugbot on PR #6250.
1 parent 776c6f9 commit 02180df

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

scripts/setup/docker.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,15 @@ function currentDockerContext(): string | null {
3333
* Which GUI app owns the `docker` CLI on this Mac. Docker Desktop and OrbStack
3434
* both install a `docker` binary, so presence of the CLI alone doesn't tell us
3535
* which app to relaunch. Prefer the docker CLI's own active context — it's
36-
* accurate regardless of where the app bundle lives — and fall back to
37-
* checking the well-known `.app` install paths when the context doesn't say.
36+
* accurate regardless of where the app bundle lives, and authoritative when
37+
* both apps are installed but only one is the active context. Only fall back
38+
* to checking the well-known `.app` install path when the context command
39+
* gives no answer at all.
3840
*/
3941
function macDockerApp(): typeof ORBSTACK_APP | typeof DOCKER_DESKTOP_APP {
40-
if (currentDockerContext() === 'orbstack') return ORBSTACK_APP
41-
if (existsSync(ORBSTACK_APP.path)) return ORBSTACK_APP
42-
return DOCKER_DESKTOP_APP
42+
const context = currentDockerContext()
43+
if (context !== null) return context === 'orbstack' ? ORBSTACK_APP : DOCKER_DESKTOP_APP
44+
return existsSync(ORBSTACK_APP.path) ? ORBSTACK_APP : DOCKER_DESKTOP_APP
4345
}
4446

4547
/**

0 commit comments

Comments
 (0)