Repository navigation
feat(engine): add engineProvider to run Lando on OrbStack, Rancher Desktop or Podman (macOS) - #510
Draft
jordan8037310 wants to merge 3 commits into
Draft
jordan8037310 wants to merge 3 commits into
jordan8037310 wants to merge 3 commits 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>
On macOS without /Applications/Docker.app (e.g. OrbStack or Colima only), getVersions() returned desktop: null and is-compatible-version threw "Cannot read properties of null (reading 'trim')". Report 'skip', as the win32 branch already does, guard the semver check in up(), and treat an unparseable version as incompatible instead of throwing. Fixes lando#138 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…sktop or Podman (macOS) Lando 3 on macOS assumes Docker Desktop: it reads Docker.app's plist for the version, starts the engine with `docker desktop start` / `open Docker.app`, installs Docker Desktop during `lando setup`, and requires Docker.app in the landonet setup task. Add one seam, utils/get-engine-provider.js, selected by the new `engineProvider` config (auto | docker-desktop | orbstack | rancher | podman): - auto (default) keeps today's behavior: Docker Desktop whenever /Applications/Docker.app exists, else OrbStack, else Rancher Desktop. Podman is opt-in only. - an explicit provider supplies the socket (dockerode and DOCKER_HOST) and the start command (orbctl start / rdctl start / podman machine start); re-opening a stopped engine's app with `open -a` is a no-op, so each engine's own cli is used - other providers skip the Docker Desktop version check, install, and the landonet Docker.app check; the landonet task's daemon now gets the provider instead of falling back to Docker Desktop and relaunching it - providers can declare unprivilegedPorts (podman's gvproxy cannot bind < 1024 on 127.0.0.1 on macOS, so the proxy uses 8000/4433 on loopback) and selinux (the podman machine enforces selinux, so the proxy's docker socket mount gets label=disable) Linux, Windows and WSL paths are unchanged. 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=510 -f commit_sha=f6dcc8f74b90537e8879cf90961d4c5ca8705fc6or 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, #138. Builds on #508 and #509, so please review those first.
Lando 3 on macOS assumes Docker Desktop in several places:
Docker.app's plist for the versiondocker desktop startoropen /Applications/Docker.applando setupinstalls Docker DesktopDocker.appThe current OrbStack guide works around this with
sudo ln -s /Applications/OrbStack.app /Applications/Docker.app.This PR adds one small seam: an engine provider.
Behavior
docker-desktop/var/run/docker.sockorbstack~/.orbstack/run/docker.sockorbctl startrancher(dockerd/moby mode)~/.rd/docker.sockrdctl startpodman(opt-in only, rootful machine)$TMPDIR/podman/podman-machine-default-api.sockpodman machine startPodman needs two small, generic provider flags:
unprivilegedPorts: Podman's port forwarder (gvproxy) runs without root, and macOS refuses ports below 1024 on127.0.0.1to non-root processes. The proxy therefore stays on loopback and uses 8000/4433 instead of falling back to binding every interface.selinux: the Podman VM enforces SELinux, so the proxy's docker socket mount getslabel=disable. Without it, Traefik is denied the socket and serves 404 for every app.autonever picks Podman, because having the CLI installed doesn't mean a machine exists.autois the default and keeps today's behavior: Docker Desktop whenever/Applications/Docker.appexists. Otherwise it picks OrbStack, then Rancher Desktop. Existing users see no change.An explicit provider supplies the socket to dockerode and, via fix(engine): use the configured socket for docker and docker compose too #509, to
dockeranddocker composeasDOCKER_HOST.The daemon starts the provider with its own CLI.
open -ais not enough, because once the engine has been stopped (orbctl stop), re-opening the menu bar app does not restart it.No Docker Desktop version check or update warning on other providers. They report
desktop: 'skip'.lando setupskips the Docker Desktop install on other providers.The landonet setup task passes the provider to the daemon it creates. Before, that daemon fell back to
auto, picked Docker Desktop, and relaunched it.Linux, Windows and WSL are untouched.
Validation
test/get-engine-provider.spec.js(6 cases):autoresolution order, explicit providers, unknown provider error.test/daemon.spec.js:up()runsorbctl startfor OrbStackgetVersions()returnsskipon other providers without reading the plisttest/lando-setup-build-engine-darwin.spec.js: the install task exists for Docker Desktop, and is absent for OrbStack and Rancher.test/lando-setup-landonet.spec.js: the setup daemon receives the configured provider. Mutation-checked: it fails onmain.npm teston Node 20: lint clean, all unit specs pass.Manual validation (macOS 26, Apple Silicon)
Docker Desktop–free run, OrbStack 2.2.3:
orbctl stop.drupal10recipe app, runlando startwithengineProvider: orbstack.orbctl startitself.https://<app>.lndo.sitereturns 200.lando drush statusbootstraps.lando db-export/lando db-importround trip works./app,host.lando.internaland SSH keys all work. OrbStack also provides/run/host-services/ssh-auth.sock.lando poweroffstops everything. The docker context and/var/run/docker.sockare unchanged.Docker Desktop–free run, Rancher Desktop 1.24.0 (moby, VZ + virtiofs, Administrative Access off):
rdctl shutdown.lando startwithengineProvider: rancherrunsrdctl start. The app serves through the proxy in about 25 s.host.lando.internaland SSH keys work. The/run/host-services/ssh-auth.sockagent socket does not exist on Rancher; that is a known gap, out of scope here.Docker Desktop–free run, Podman 6.1.4 (rootful, applehv):
lando startboots the machine itself withpodman machine start(46 s from stopped).drupal10recipe serves HTTPS on:4433.db-export/db-import, UID mapping,host.lando.internalandlando rebuildall pass.Bind-mount benchmark, OrbStack vs Docker Desktop (same machine,
alpine, median of 3; Docker Desktop was also running other containers):find+tarof a largenode_modulesThree-engine comparison (M3 Max; round-robin, median of 5, all engines under the same background load):
Notes for reviewers
orbstackandcredsStoretoosxkeychain.rancher-desktopwhenever Docker Desktop's socket is missing.DOCKER_HOST, but a follow-up docs PR will cover it.genericprovider that reads the active docker context🤖 Generated with Claude Code