{"record":{"id":"18a7ad768ae6b104","repo":"Hmbown/CodeWhale","slug":"docker-unavailable","errorCode":"docker_unavailable","errorMessage":"A Linux Docker engine is required — start Docker Desktop in Linux-container mode (or Colima) and spawn again","messagePattern":"A Linux Docker engine is required — start Docker Desktop in Linux-container mode \\(or Colima\\) and spawn again","errorType":"error_code","errorClass":"SpawnError","httpStatus":null,"severity":"error","filePath":"crates/tui/plugins/computer-use/src/spawn.mjs","lineNumber":77,"sourceCode":"  const inspect = await docker([\"image\", \"inspect\", image], { timeoutMs: 15_000 });\n  if (inspect.code === 0) return { built: false };\n  if (image !== DEFAULT_IMAGE) {\n    throw new SpawnError(\"spawn_image_missing\", `docker image \"${image}\" is not present locally`);\n  }\n  const r = await docker([\"build\", \"-t\", image, \"-f\", path.join(PLUGIN_ROOT, \"docker\", \"Dockerfile\"), PLUGIN_ROOT], { timeoutMs: 15 * 60_000 });\n  if (r.aborted) throw Object.assign(new ExecError(\"computer request cancelled\", r), { code: \"cancelled\" });\n  if (r.code !== 0) throw new SpawnError(\"spawn_failed\", `docker build ${image} failed: ${trim(r.stderr || r.stdout, 800)}`, r);\n  return { built: true };\n}\n\n/**\n * Start a disposable desktop container and verify the agent answers inside\n * its session. On any failure the container is removed — spawn is\n * transactional: either a live computer comes back or nothing was left.\n */\nexport async function spawnDockerComputer({ id, image = DEFAULT_IMAGE } = {}) {\n  if (!await dockerAvailable()) {\n    throw new SpawnError(\"docker_unavailable\", \"A Linux Docker engine is required — start Docker Desktop in Linux-container mode (or Colima) and spawn again\");\n  }\n  const { built } = await ensureImage(image);\n  const container = `cu-spawn-${id}-${crypto.randomBytes(3).toString(\"hex\")}`;\n  const cleanup = async () => {\n    await docker([\"rm\", \"-f\", container], { timeoutMs: 15_000, signal: null }).catch(() => {});\n  };\n  try {\n    // --init reaps the desktop's children; --ipc=host keeps Chromium off the\n    // 64MB default /dev/shm, same as docker/run.sh. \"sleep infinity\" is the\n    // payload — the image entrypoint stands up Xvfb/openbox/the session bus\n    // first, and the agent is exec'd in per request.\n    await dockerOk([\n      \"run\", \"-d\", \"--name\", container,\n      \"--init\", \"--ipc=host\",\n      \"--label\", `${SPAWN_LABEL}=1`,\n      \"--label\", `${SESSION_LABEL}=${SESSION_ID}`,\n      \"--label\", `${COMPUTER_LABEL}=${id}`,\n      image, \"sleep\", \"infinity\",","sourceCodeStart":59,"sourceCodeEnd":95,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/plugins/computer-use/src/spawn.mjs#L59-L95","documentation":"Thrown by spawnDockerComputer() before doing any work when dockerAvailable() reports there is no usable Linux Docker engine. The plugin requires a Linux-container engine (it checks `docker info --format {{.OSType}}` returns \"linux\" within 10s); Docker Desktop in Windows-container mode or a non-Linux engine is rejected up front with this actionable message.","triggerScenarios":"spawnDockerComputer() called while: docker CLI missing, daemon stopped, Docker Desktop set to Windows containers (OSType != \"linux\"), or the `docker info` probe times out.","commonSituations":"Docker Desktop not started after reboot, Windows containers mode active, Colima VM not running on macOS, DOCKER_HOST pointing at a dead remote, or docker not installed in a container/CI image.","solutions":["Start Docker Desktop (in Linux-container mode) or run `colima start`, then spawn again.","On Docker Desktop for Windows, switch to Linux containers via the tray icon ('Switch to Linux containers...').","Verify with `docker info --format '{{.OSType}}'` — it must print `linux`.","If docker is not installed, install Docker Engine/Colima first."],"exampleFix":"// before (Windows)\n$ docker info --format '{{.OSType}}'\nwindows\n// after\n// Docker Desktop tray -> 'Switch to Linux containers...', then:\n$ docker info --format '{{.OSType}}'\nlinux","handlingStrategy":"validation","validationCode":"import { execFile } from \"node:child_process\";\nimport { promisify } from \"node:util\";\nconst pexec = promisify(execFile);\nasync function linuxDockerReady() {\n  try {\n    const { stdout } = await pexec(\"docker\", [\"info\", \"--format\", \"{{.OSType}}\"], { timeout: 10_000 });\n    return stdout.trim() === \"linux\";\n  } catch { return false; }\n}","typeGuard":null,"tryCatchPattern":"try {\n  await spawnDockerComputer();\n} catch (e) {\n  if (e?.code === \"docker_unavailable\") {\n    // show the message's actionable guidance: start Docker Desktop in Linux mode or Colima\n  }\n}","preventionTips":["Start Docker Desktop/Colima as part of your dev-session bootstrap.","On Windows, keep Docker Desktop in Linux-container mode.","Gate the feature behind a `docker info` OSType === \"linux\" check.","Ensure the docker CLI is installed in CI/container images."],"tags":["docker","environment","prerequisite","linux"],"backgroundTag":"unsupported-platform","analyzedSha":"73e0f67d83c59909b571efdfc88c4bc28c309cb1","analyzedAt":"2026-09-22T01:30:00.501Z","contentChangedAt":"2026-09-22T01:30:00.501Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}