Repository navigation
fix(engine): use the configured socket for docker and docker compose too - #509
Draft
jordan8037310 wants to merge 1 commit into
Draft
jordan8037310 wants to merge 1 commit into
jordan8037310 wants to merge 1 commit into
Conversation
engineConfig.socketPath (the lando/lando#3388 workaround for non Docker Desktop engines) only reached dockerode. build-config strips DOCKER_* and get-engine-config re-exported DOCKER_HOST only for a tcp host, so the docker and docker compose subprocesses followed the active docker context and could run against a different engine. - export DOCKER_HOST=unix://<socketPath> for any non-default socket - keep the configured engineConfig after first-run autosetup instead of rebuilding it from defaults, which reset it to /var/run/docker.sock Refs lando/lando#3388 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
👷 Deploy request for lando-core pending review.Visit the deploys page to approve it
|
Contributor
Privileged Leia tests skippedThe After reviewing gh workflow run pr-core-tests.yml --repo lando/core -f pull_request=509 -f commit_sha=5ca4d791f8656d6b8fb2bcb90a3f42ff52d387e0or from the workflow page using the same inputs. This comment updates when new commits are pushed and the dispatch only accepts the current head commit. |
This branch has not been deployed
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.
Refs lando/lando#3388.
The workaround in #3388 for running Lando on a non–Docker Desktop engine sets
engineConfig.socketPathin~/.lando/config.yml. It only half works, and this PR fixes the two reasons why.1. Only dockerode uses the configured socket
engineConfig.socketPathis passed to dockerode, but thedockeranddocker composesubprocesses don't receive it. They follow whatever docker context is active.build-configstripsDOCKER_*from the environment, andget-engine-configonly re-exportsDOCKER_HOSTfor a TCP host.docker compose upcreates them on the other.Change: export
DOCKER_HOST=unix://<socketPath>whenever the socket is not the default/var/run/docker.sock, on non-Windows platforms. With the default socket, nothing changes.2. First-run autosetup resets the engine
hooks/lando-run-setup.jsreloads config withbuild-config()and no options.engineConfigresets to the default socket, andDOCKER_HOSTis stripped again.lando startafter setup therefore silently runs against/var/run/docker.sock.Change: keep
lando.config.engineConfigand re-runget-engine-configon it to re-exportDOCKER_HOST, instead of rebuilding the engine config from defaults.Validation
test/get-engine-config.spec.js:DOCKER_HOSTunsetsocketPathexportsunix://…tcp://…test/lando-run-setup.spec.js: a custom socket survives a setup run, inlando.config, in the rebuilt dockerode client, and inDOCKER_HOST.main. The run-setup spec was also mutation-checked against the old hook.npm teston Node 20: lint clean, all unit specs pass.engineConfig.socketPathto OrbStack's socket while the docker context still points at Docker Desktop.lando startcreates every container on OrbStack, checked withdocker --context orbstack ps. Nothing appears on Docker Desktop.🤖 Generated with Claude Code