Skip to content

Fix Docker Desktop detection via ~/.docker/run/docker.sock#206

Merged
carole-lavillonniere merged 1 commit intomainfrom
drg-754-probe-dockerrundockersock-for-docker-availability
Apr 27, 2026
Merged

Fix Docker Desktop detection via ~/.docker/run/docker.sock#206
carole-lavillonniere merged 1 commit intomainfrom
drg-754-probe-dockerrundockersock-for-docker-availability

Conversation

@carole-lavillonniere
Copy link
Copy Markdown
Collaborator

Motivation

Docker Desktop on macOS uses ~/.docker/run/docker.sock when the /var/run/docker.sock symlink is absent. lstk only probed the standard path, causing false "Docker is not available" errors even with Docker Desktop running.

Changes

  • Add ~/.docker/run/docker.sock to the socket probe list in findDockerSocket()
  • Extract vmSocketPaths() as single source of truth used by both findDockerSocket() and isVM() — previously two separate lists that could drift
  • Add Lima host socket (~/.lima/docker/sock/docker.sock) to isVM(), which was missing: containers bind-mount /var/run/docker.sock regardless of the host-side socket path
  • Convert repetitive VM detection subtests to table-driven tests; adding a new runtime now requires only one entry

Tests

Unit tests cover all VM socket paths for both discovery (findDockerSocket) and bind-mount path remapping (isVM/SocketPath).

Closes DRG-754

Docker Desktop on macOS uses ~/.docker/run/docker.sock when the
/var/run/docker.sock symlink is absent. Extract vmSocketPaths() as
single source of truth for findDockerSocket() and isVM(); fixes
Lima host socket missing from isVM().

Closes DRG-754
Copy link
Copy Markdown
Contributor

@anisaoshafi anisaoshafi left a comment

Choose a reason for hiding this comment

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

Thank you 👏🏼

@carole-lavillonniere carole-lavillonniere merged commit 496c91d into main Apr 27, 2026
8 of 9 checks passed
@carole-lavillonniere carole-lavillonniere deleted the drg-754-probe-dockerrundockersock-for-docker-availability branch April 27, 2026 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants