nikivdev/code · error · anyhow::Error

docker is required for local domains. Install Docker/OrbStac

Error message

docker is required for local domains. Install Docker/OrbStack first.

What it means

Error "docker is required for local domains. Install Docker/OrbStack first." thrown in nikivdev/code.

Source

Thrown at src/domains.rs:423

fn docker_upstream(target: &str) -> (String, String) {
    let Some((host, port)) = target.rsplit_once(':') else {
        return (target.to_string(), target.to_string());
    };
    match host {
        "127.0.0.1" | "localhost" | "::1" => (
            format!("host.docker.internal:{}", port),
            "localhost".to_string(),
        ),
        _ => (format!("{}:{}", host, port), host.to_string()),
    }
}

fn ensure_docker_available() -> Result<()> {
    if docker_available() {
        Ok(())
    } else {
        bail!("docker is required for local domains. Install Docker/OrbStack first.")
    }
}

fn docker_available() -> bool {
    which::which("docker").is_ok()
}

fn run_compose(paths: &DomainsPaths, args: &[&str]) -> Result<()> {
    let output = Command::new("docker")
        .arg("compose")
        .arg("-f")
        .arg(&paths.compose)
        .args(args)
        .output()
        .context("Failed to run docker compose")?;
    ensure_success(output, "docker compose command failed")
}

View on GitHub (pinned to a747e741ae)

When it happens

Trigger: Thrown at src/domains.rs:423 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of nikivdev/code@a747e741ae (2026-09-01). Data as JSON: /api/errors/587b4fa786ac4aca. Report an issue: GitHub.