Porthole now exposes two separate integration surfaces for VS Code:
Porthole.Trayporthole-cliThey solve different problems and can be used together.
The VS Code Containers extension works against the Docker-compatible API exposed by the tray host.
Current tray transports:
http://127.0.0.1:23751/docker_enginedockerDesktopLinuxEngineFor VS Code, the most reliable path today is the HTTP endpoint via DOCKER_HOST.
The Dev Containers extension still expects a Docker CLI for several workflows. Porthole provides a CLI shim in src/porthole-cli for that surface.
The shim currently implements these commands:
versionpsinspectrunexecAdd these settings in your VS Code settings.json.
{
"containers.environment": {
"DOCKER_HOST": "tcp://127.0.0.1:23751"
}
}
Why this matters:
DOCKER_HOST in containers.environment ensures the extension talks to the Porthole tray bridge consistentlyPoint the Dev Containers extension at the Porthole CLI shim:
{
"dev.containers.dockerPath": "C:\\porthole-cli\\porthole-cli.exe"
}
If you are running from source instead of an installed copy, use the built executable path for your environment.
Example:
{
"dev.containers.dockerPath": "C:\\repos\\porthole\\src\\porthole-cli\\bin\\Debug\\net8.0-windows10.0.19041.0\\porthole-cli.exe"
}
{
"dev.containers.dockerPath": "C:\\porthole-cli\\porthole-cli.exe",
"containers.environment": {
"DOCKER_HOST": "tcp://127.0.0.1:23751"
}
}
The active session is central to how Porthole behaves.
For Dev Containers support, Porthole also uses a dedicated session name:
porthole-devcontainersThat session is used for the CLI shim and for devcontainer-oriented runtime operations.
wslc --session ParameterPorthole discovered and now depends on a hidden global wslc switch:
wslc --session <name> <command>
This is important because unscoped wslc calls do not reliably target the session that VS Code integrations are using.
Examples:
wslc --session porthole-devcontainers list --all --format json
wslc --session porthole-devcontainers inspect <container-id>
wslc --session porthole-devcontainers exec <container-id> sh -lc "echo hello"
wslc --session porthole-devcontainers images --format json
Porthole uses this session-scoped path in the tray backend for:
Without --session, the Docker-compatible API can resolve the wrong inventory or miss the devcontainer session entirely.
These routes are currently implemented by the tray bridge:
GET /_pingHEAD /_pingGET /versionGET /infoGET /networksGET /images/jsonGET /images/{id}/jsonGET /volumesGET /containers/jsonGET /containers/{id}/jsonGET /containers/{id}/logsPOST /containers/createPOST /containers/{id}/startPOST /containers/{id}/stopDELETE /containers/{id}POST /containers/{id}/execPOST /exec/{id}/startThe bridge is intentionally narrow today. The following areas still need more work for broader Docker compatibility:
Test-NetConnection 127.0.0.1 -Port 23751
Invoke-WebRequest -UseBasicParsing http://127.0.0.1:23751/v1.52/_ping
porthole-cli version
porthole-cli ps --all
If the Containers extension still does not work:
Porthole.Tray is runningcontainers.environment.DOCKER_HOST points to tcp://127.0.0.1:23751If Dev Containers still fails:
dev.containers.dockerPath points to the actual porthole-cli.exeIf session-local inventory looks wrong:
wslc --session <name> commands return the expected inventory