Skip to content

fix(gateway): probe Docker socket during driver auto-detection#2303

Open
krishicks wants to merge 1 commit into
mainfrom
hicks/push-sxspyswsmnro
Open

fix(gateway): probe Docker socket during driver auto-detection#2303
krishicks wants to merge 1 commit into
mainfrom
hicks/push-sxspyswsmnro

Conversation

@krishicks

Copy link
Copy Markdown
Collaborator

Summary

Previously, Docker was auto-detected when the CLI was installed or a candidate Unix socket existed. Neither check verified that the Docker API was responsive. A similar check was done when auto-detecting Podman in the past, but was replaced in 1f07bf0 with a probe of candidate Podman sockets instead.

This change applies the functional API probing approach introduced for Podman in 1f07bf0 to Docker. It also makes Docker driver initialization use the same socket-selection mechanism as Docker auto-detection instead of Bollard’s local defaults. This means the previously auto-detectable Docker socket paths $HOME/.docker/run/docker.sock and $XDG_RUNTIME_DIR/docker.sock will actually be usable.

When no working compute driver can be auto-detected, the gateway exits early with a message saying as much:

configuration error: no compute driver configured and auto-detection found no
suitable driver; set --drivers or OPENSHELL_DRIVERS to kubernetes, podman,
docker, or vm

This makes for a better user experience when installing OpenShell without an available supported compute driver.

Related Issue

Changes

Testing

  • mise run pre-commit passes
  • Unit tests added/updated
  • E2E tests added/updated (if applicable)

Checklist

  • Follows Conventional Commits
  • Commits are signed off (DCO)
  • Architecture docs updated (if applicable)

Previously, Docker was auto-detected when the CLI was installed or a candidate
Unix socket existed. Neither check verified that the Docker API was responsive.
A similar check was done when auto-detecting Podman in the past, but was
replaced in 1f07bf0 with a probe of candidate Podman sockets instead.

This change applies the functional API probing approach introduced for Podman
in 1f07bf0 to Docker. It also makes Docker driver initialization use the same
socket-selection mechanism as Docker auto-detection instead of Bollard’s local
defaults. This means the previously auto-detectable Docker socket paths
$HOME/.docker/run/docker.sock and $XDG_RUNTIME_DIR/docker.sock will actually be
usable.

When no working compute driver can be auto-detected, the gateway exits early
with a message saying as much:

> configuration error: no compute driver configured and auto-detection found no
> suitable driver; set --drivers or OPENSHELL_DRIVERS to kubernetes, podman,
> docker, or vm

This makes for a better user experience when installing OpenShell without an
available supported compute driver.

Signed-off-by: Kris Hicks <khicks@nvidia.com>
@github-actions

Copy link
Copy Markdown

@krishicks krishicks enabled auto-merge July 15, 2026 20:40
unix_socket_http_ping(path, |response| {
http_response_is_success(response)
&& contains_ascii(response, b"Api-Version:")
&& !contains_ascii(response, b"Libpod-Api-Version:")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This negative check ensures that were not detecting a symlinked podman socket, correct?

/// Docker API Unix socket. When unset, use the socket selected by gateway
/// auto-detection, falling back to `/var/run/docker.sock` for an explicitly
/// configured Docker driver.
pub socket_path: Option<PathBuf>,

@elezar elezar Jul 15, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

naming nit: We already have a ssh_socket_path. Do we need a more explicit name to distinguish between the two?

Comment thread architecture/compute-runtimes.md

@elezar elezar left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor naming nit and a question. LGTM though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants