fix(gateway): probe Docker socket during driver auto-detection#2303
Open
krishicks wants to merge 1 commit into
Open
fix(gateway): probe Docker socket during driver auto-detection#2303krishicks wants to merge 1 commit into
krishicks wants to merge 1 commit into
Conversation
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>
|
🌿 Preview your docs: https://nvidia-preview-pr-2303.docs.buildwithfern.com/openshell |
elezar
reviewed
Jul 15, 2026
| unix_socket_http_ping(path, |response| { | ||
| http_response_is_success(response) | ||
| && contains_ascii(response, b"Api-Version:") | ||
| && !contains_ascii(response, b"Libpod-Api-Version:") |
Member
There was a problem hiding this comment.
This negative check ensures that were not detecting a symlinked podman socket, correct?
elezar
reviewed
Jul 15, 2026
| /// 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>, |
Member
There was a problem hiding this comment.
naming nit: We already have a ssh_socket_path. Do we need a more explicit name to distinguish between the two?
elezar
reviewed
Jul 15, 2026
elezar
approved these changes
Jul 15, 2026
elezar
left a comment
Member
There was a problem hiding this comment.
Minor naming nit and a question. LGTM though.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
This makes for a better user experience when installing OpenShell without an available supported compute driver.
Related Issue
Changes
Testing
mise run pre-commitpassesChecklist