Skip to content
Draft
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
f1820f7
feat: add engine backend interface for multi-engine support
AaronFeledy Mar 13, 2026
9d73794
feat: add Docker backend wrapping existing engine code
AaronFeledy Mar 13, 2026
18ecd05
feat: add containerd daemon manager
AaronFeledy Mar 13, 2026
c0bbb00
feat: add containerd container manager (nerdctl wrapper)
AaronFeledy Mar 13, 2026
cad27e7
feat: add nerdctl compose adapter
AaronFeledy Mar 13, 2026
40000b1
feat: add backend selection and configuration
AaronFeledy Mar 13, 2026
c623d21
feat: add binary management for containerd/nerdctl/buildkit
AaronFeledy Mar 13, 2026
1952476
feat: add tests and docs for containerd engine support
AaronFeledy Mar 13, 2026
6c05b2d
feat: wire BackendManager into lando.js bootstrap
AaronFeledy Mar 14, 2026
270c369
feat: add lando setup hooks for containerd binaries
AaronFeledy Mar 14, 2026
9eff2a6
feat: add Lima VM integration for macOS containerd support
AaronFeledy Mar 14, 2026
c8c5a14
feat: update Engine for containerd version checking
AaronFeledy Mar 14, 2026
36923bd
feat: register containerd setup hooks in index.js
AaronFeledy Mar 14, 2026
980f6bd
feat: add containerd integration tests
AaronFeledy Mar 14, 2026
b064ca0
feat: add containerd compatibility check hooks
AaronFeledy Mar 14, 2026
05d105d
feat: add WSL2 containerd isolation support
AaronFeledy Mar 14, 2026
da24125
feat: register containerd compat hooks and verify docker proxy
AaronFeledy Mar 14, 2026
9dca7db
feat: add containerd version info hook
AaronFeledy Mar 14, 2026
5c38568
feat: add containerd smoke test script
AaronFeledy Mar 14, 2026
6ed6c1a
fix: address branch review findings
AaronFeledy Mar 14, 2026
abd2ef0
Fix backend logic bugs: add default opts, accept version info in warn…
cursoragent Mar 14, 2026
440b97e
docs: add containerd engine todo list (tasks 22-31)
AaronFeledy Mar 14, 2026
e6d3afe
feat: add Lima setup hook for macOS lando setup
AaronFeledy Mar 14, 2026
7729c16
feat: add shared containerd config generator
AaronFeledy Mar 14, 2026
63516bb
feat: add BuildKit config and cache management
AaronFeledy Mar 14, 2026
1b395e6
feat: add registry authentication support for containerd/nerdctl
AaronFeledy Mar 14, 2026
09b9a7e
Fix backend logic bugs: add default opts, accept version info in warn…
cursor[bot] Mar 14, 2026
854cb9f
feat: add volume mount compatibility layer for containerd
AaronFeledy Mar 14, 2026
1be7349
feat: add networking parity for containerd/nerdctl backend
AaronFeledy Mar 14, 2026
22f5771
feat: add finch-daemon for Docker API compatibility with containerd
AaronFeledy Mar 14, 2026
4e2e99e
feat: add engine selection UX and containerd doctor checks
AaronFeledy Mar 14, 2026
5784ca6
feat: add containerd error messages and troubleshooting
AaronFeledy Mar 14, 2026
678de49
feat: add performance benchmarking and perf logging for containerd
AaronFeledy Mar 14, 2026
9f53c2d
ci: run Leia tests against both docker and containerd engines
AaronFeledy Mar 14, 2026
a0e6931
Fix containerd integration bugs
cursoragent Mar 14, 2026
73a5b28
fix: nerdctl tarball entry path (root, not bin/)
AaronFeledy Mar 14, 2026
f87eb45
fix: TOML config structure — top-level keys before sections
AaronFeledy Mar 14, 2026
82cfe1b
fix: containerd setup and runtime fixes for functional parity
AaronFeledy Mar 14, 2026
b41d2b6
feat: rootless containerd support and functional runtime
AaronFeledy Mar 14, 2026
bc4b1d4
fix: runtime bugs for containerd engine parity
AaronFeledy Mar 14, 2026
a73dfd5
fix: prevent lando-reset-orchestrator from replacing containerd engine
AaronFeledy Mar 14, 2026
525fb9a
fix: skip app-level orchestrator reset for containerd engine
AaronFeledy Mar 14, 2026
bcca717
fix: app.js must use lando.engine instead of creating its own
AaronFeledy Mar 14, 2026
513f08c
fix: sanitize Docker config when credsStore helper is missing
AaronFeledy Mar 14, 2026
abf6ce8
fix: sanitize credsStore for nerdctl and pass auth to compose
AaronFeledy Mar 14, 2026
31c853c
feat: rootless port allocation for nerdctl compose
AaronFeledy Mar 15, 2026
5f2f969
fix: wrap ContainerdContainer returns in Bluebird promises
AaronFeledy Mar 15, 2026
7de2358
feat: switch to rootful containerd with systemd service
AaronFeledy Mar 15, 2026
c1dc204
feat: use docker-compose + finch-daemon instead of nerdctl compose
AaronFeledy Mar 15, 2026
c376f7c
feat: move sockets to /run/lando/ (root-owned, group-accessible)
AaronFeledy Mar 15, 2026
07014b3
fix: add finch-daemon to setup and systemd service
AaronFeledy Mar 15, 2026
5df6efa
perf: speed up lando setup by eliminating expensive daemon.up() calls…
AaronFeledy Mar 15, 2026
c41b5c0
fix: skip Docker Engine install when engine is containerd
AaronFeledy Mar 15, 2026
e43c728
feat: replace nerdctl with Dockerode for container operations
AaronFeledy Mar 15, 2026
7a68b80
fix: landonet depends on containerd service, fix orchestratorBin
AaronFeledy Mar 15, 2026
269033f
fix: service hasRun checks finch.sock + containerd.sock existence
AaronFeledy Mar 15, 2026
c08f532
fix: use systemctl restart (not start) for service update
AaronFeledy Mar 15, 2026
0a2d87c
fix: remove unix:// prefix from finch-daemon socket-addr
AaronFeledy Mar 15, 2026
afb01b9
fix: create CNI config dirs in systemd ExecStartPre
AaronFeledy Mar 15, 2026
2444814
fix: create CNI dirs during setup task, not just ExecStartPre
AaronFeledy Mar 15, 2026
d8ccba7
fix: create /etc/cni/net.d/finch subdirectory for finch-daemon
AaronFeledy Mar 15, 2026
e4fffb7
fix: set CONTAINERD_ADDRESS for finch-daemon in systemd service
AaronFeledy Mar 15, 2026
d78dd06
fix: symlink containerd socket to default path for finch-daemon
AaronFeledy Mar 15, 2026
da922de
fix: replace nerdctl health check with Dockerode ping via finch
AaronFeledy Mar 15, 2026
e1639d3
fix: use NERDCTL_TOML for finch-daemon instead of socket symlink
AaronFeledy Mar 15, 2026
47ef985
fix: hasRun checks for nerdctl.toml to detect config changes
AaronFeledy Mar 15, 2026
4a56845
fix: symlink CNI plugins from /usr/lib/cni to /opt/cni/bin
AaronFeledy Mar 15, 2026
f774732
fix: set DOCKER_CONTEXT=default to prevent Docker Desktop WSL path ma…
AaronFeledy Mar 15, 2026
a1ce102
fix: add system bin dir to PATH in systemd service for runc
AaronFeledy Mar 15, 2026
232ad8f
feat(containerd): engine setup, hooks, tests, and utilities
AaronFeledy Mar 21, 2026
1eaad1b
fix(containerd): remove nerdctl from user-facing code paths and fix a…
AaronFeledy Mar 21, 2026
af2f1e8
feat(containerd): add Traefik proxy compatibility with containerd bac…
AaronFeledy Mar 21, 2026
34db526
feat(containerd): isolate CNI paths, fix permissions, add troubleshoo…
AaronFeledy Mar 27, 2026
af1c4e3
feat(containerd): ensure CNI configs for all compose-defined networks…
AaronFeledy Mar 27, 2026
4d63559
fix(containerd): fix binary path check, add test coverage, deprecate …
AaronFeledy Mar 28, 2026
d4112de
test(containerd): add LimaManager/WslHelper unit tests, update smoke …
AaronFeledy Mar 28, 2026
fa7043c
fix(containerd): fix outbound internet, ephemeral state dir, OCI hook…
AaronFeledy Mar 28, 2026
dab5b91
fix(containerd): multi-container orchestration — fix finch-daemon net…
AaronFeledy Mar 28, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,9 @@ module.exports = async (app, lando) => {
// Check for docker compat warnings and surface them nicely as well
app.events.on('post-start', async () => await require('./hooks/app-check-docker-compat')(app, lando));

// Check for containerd compat warnings and surface them nicely as well
app.events.on('post-start', async () => await require('./hooks/app-check-containerd-compat')(app, lando));

// throw service not start errors
app.events.on('post-start', 1, async () => await require('./hooks/app-check-v4-service-running')(app, lando));

Expand Down
89 changes: 89 additions & 0 deletions docs/config/engine.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
---
title: Engine
description: How to configure the Lando container engine backend (Docker or containerd)
---

# Engine

Lando supports multiple container engine backends. By default it uses [Docker](https://www.docker.com/) but can also use [containerd](https://containerd.io/) with [nerdctl](https://github.com/containerd/nerdctl) as an alternative runtime.

The engine backend can be configured via the `engine` key in the [global config](global.md) or per-project in your `.lando.yml`.

## Available Values

| Value | Description |
|---|---|
| `auto` | **(default)** Auto-detects the best available backend. Prefers containerd if all binaries are found, otherwise falls back to Docker. |
| `docker` | Always use the Docker daemon and Docker Compose. This is the traditional Lando behavior. |
| `containerd` | Use Lando's own isolated containerd + buildkitd + nerdctl stack. |

## Configuration

**Global config (~/.lando/config.yml)**

```yaml
# use auto-detection (default)
engine: auto

# force Docker
engine: docker

# force containerd
engine: containerd
```

**Per-project (.lando.yml)**

```yaml
name: my-app
engine: containerd
services:
web:
type: php:8.2
via: nginx
```

## Auto-Detection

When `engine` is set to `auto` (the default), Lando checks for the presence of three binaries inside `~/.lando/bin/`:

1. `containerd` — the container runtime daemon
2. `nerdctl` — the Docker-compatible CLI for containerd
3. `buildkitd` — the image build daemon

If **all three** binaries exist, Lando uses the containerd backend. If any are missing, it falls back to Docker.

::: tip
The containerd binaries are installed automatically by `lando setup` when containerd support is enabled. You don't need to install them manually.
:::

## Overriding Binary Paths

If your containerd stack binaries are installed in a non-standard location, you can override each path individually in the [global config](global.md):

```yaml
# Override individual binary paths
containerdBin: /usr/local/bin/containerd
nerdctlBin: /usr/local/bin/nerdctl
buildkitdBin: /usr/local/bin/buildkitd

# Override the containerd socket path
containerdSocket: /run/containerd/containerd.sock
```

By default, Lando looks for binaries in `~/.lando/bin/` and manages its own isolated containerd socket at `~/.lando/run/containerd.sock`.

## How It Works

When using the containerd backend, Lando:

1. Starts its **own isolated** containerd and buildkitd daemons (separate from any system containerd)
2. Uses `nerdctl compose` instead of `docker compose` for service orchestration
3. Uses `nerdctl` instead of `docker` for container inspection, listing, and management
4. Manages all state in `~/.lando/` to avoid interfering with system containers

The containerd backend is fully compatible with existing Lando apps and compose files — no changes to your `.lando.yml` services are required.

::: warning EXPERIMENTAL
The containerd engine backend is experimental. While it is designed to be a drop-in replacement for the Docker backend, some edge cases may behave differently. Please report any issues you encounter.
:::
84 changes: 84 additions & 0 deletions hooks/app-check-containerd-compat.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
'use strict';

const _ = require('lodash');

module.exports = async (app, lando) => {
// Skip if not using the containerd backend
const backend = _.get(lando, 'engine.engineBackend', _.get(lando, 'config.engine', 'auto'));
if (backend !== 'containerd') return;

_.forEach(_(lando.versions).filter(version => version && !version.dockerVersion).value(), thing => {
// handle generic unsupported or untested notices
if (!thing.satisfied) app.addMessage(require('../messages/unsupported-version-warning')({

Check failure on line 12 in hooks/app-check-containerd-compat.js

View workflow job for this annotation

GitHub Actions / lint (ubuntu-24.04, 20)

Expected { after 'if' condition

Check failure on line 12 in hooks/app-check-containerd-compat.js

View workflow job for this annotation

GitHub Actions / docs-tests (ubuntu-24.04, 20)

Expected { after 'if' condition

Check failure on line 12 in hooks/app-check-containerd-compat.js

View workflow job for this annotation

GitHub Actions / npm (20)

Expected { after 'if' condition
...thing,
name: thing.name,
}));
if (thing.untested) app.addMessage(require('../messages/untested-version-notice')(thing));

// handle nerdctl (compose equivalent) recommend update
if (thing.name === 'nerdctl' && thing.rupdate) {
app.addMessage(require('../messages/update-nerdctl-warning')(thing));
}
});

// Run live containerd-specific health checks
try {
const daemon = lando.engine.daemon;

// Verify containerd daemon is running
const isUp = await daemon.isUp();
if (!isUp) {
app.addMessage({
type: 'warning',
title: 'Containerd daemon is not running',
detail: [
'The containerd daemon does not appear to be running.',
'Lando needs containerd to manage containers. Try running "lando start"',
'which will attempt to start the daemon automatically.',
],
});
}

// Verify nerdctl compose is functional
if (isUp) {
try {
const runCommand = require('../utils/run-command');
await runCommand(daemon.nerdctlBin, ['compose', 'version'], {
debug: daemon.debug,
ignoreReturnCode: false,
});
} catch (err) {
app.addMessage({
type: 'warning',
title: 'nerdctl compose is not functional',
detail: [
'Could not run "nerdctl compose version" successfully.',
'nerdctl compose is required for service orchestration.',
`Error: ${err.message}`,
],
url: 'https://github.com/containerd/nerdctl/releases',
});
}

// Verify buildkitd is running
const buildkitRunning = daemon._isProcessRunning
? daemon._isProcessRunning(daemon.buildkitdPidFile)
: false;

if (!buildkitRunning) {
app.addMessage({
type: 'warning',
title: 'BuildKit daemon is not running',
detail: [
'The BuildKit daemon (buildkitd) does not appear to be running.',
'BuildKit is required for building container images with the containerd backend.',
'Try running "lando start" which will attempt to start buildkitd automatically.',
],
url: 'https://github.com/moby/buildkit/releases',
});
}
}
} catch (err) {
lando.log.debug('containerd health check encountered an error: %s', err.message);
}
};
26 changes: 26 additions & 0 deletions hooks/lando-add-containerd-version-info.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
"use strict";

Check failure on line 1 in hooks/lando-add-containerd-version-info.js

View workflow job for this annotation

GitHub Actions / lint (ubuntu-24.04, 20)

Strings must use singlequote

Check failure on line 1 in hooks/lando-add-containerd-version-info.js

View workflow job for this annotation

GitHub Actions / docs-tests (ubuntu-24.04, 20)

Strings must use singlequote

Check failure on line 1 in hooks/lando-add-containerd-version-info.js

View workflow job for this annotation

GitHub Actions / npm (20)

Strings must use singlequote

module.exports = async lando => {
// Only run for containerd backend
if (!lando.engine || lando.engine.engineBackend !== "containerd") return;

Check failure on line 5 in hooks/lando-add-containerd-version-info.js

View workflow job for this annotation

GitHub Actions / lint (ubuntu-24.04, 20)

Strings must use singlequote

Check failure on line 5 in hooks/lando-add-containerd-version-info.js

View workflow job for this annotation

GitHub Actions / docs-tests (ubuntu-24.04, 20)

Strings must use singlequote

Check failure on line 5 in hooks/lando-add-containerd-version-info.js

View workflow job for this annotation

GitHub Actions / npm (20)

Strings must use singlequote

try {
const versions = await lando.engine.daemon.getVersions();
lando.log.debug("containerd versions: %o", versions);

Check failure on line 9 in hooks/lando-add-containerd-version-info.js

View workflow job for this annotation

GitHub Actions / lint (ubuntu-24.04, 20)

Strings must use singlequote

Check failure on line 9 in hooks/lando-add-containerd-version-info.js

View workflow job for this annotation

GitHub Actions / docs-tests (ubuntu-24.04, 20)

Strings must use singlequote

Check failure on line 9 in hooks/lando-add-containerd-version-info.js

View workflow job for this annotation

GitHub Actions / npm (20)

Strings must use singlequote

// Add to lando.versions alongside any Docker version info
if (!lando.versions) lando.versions = [];

for (const [name, version] of Object.entries(versions)) {
if (!version) continue;
lando.versions.push({
name,
version,
dockerVersion: false,
satisfied: true,
});
}
} catch (err) {
lando.log.warn("could not retrieve containerd version info: %s", err.message);

Check failure on line 24 in hooks/lando-add-containerd-version-info.js

View workflow job for this annotation

GitHub Actions / lint (ubuntu-24.04, 20)

Strings must use singlequote

Check failure on line 24 in hooks/lando-add-containerd-version-info.js

View workflow job for this annotation

GitHub Actions / docs-tests (ubuntu-24.04, 20)

Strings must use singlequote

Check failure on line 24 in hooks/lando-add-containerd-version-info.js

View workflow job for this annotation

GitHub Actions / npm (20)

Strings must use singlequote
}
};
18 changes: 18 additions & 0 deletions hooks/lando-get-containerd-compat.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
'use strict';

const _ = require('lodash');

module.exports = async lando => {
// only run if engine bootstrap or above, containerd backend, and daemon is available
if (lando._bootstrapLevel >= 3) {
const backend = _.get(lando, 'engine.engineBackend', _.get(lando, 'config.engine', 'auto'));
if (backend === 'containerd' && lando.engine.dockerInstalled) {
lando.engine.getCompatibility().then(results => {
lando.log.verbose('checking containerd version compatibility...');
lando.log.debug('containerd compatibility results', _.keyBy(results, 'name'));
lando.cache.set('versions', _.assign(lando.versions, _.keyBy(results, 'name')), {persist: true});
lando.versions = lando.cache.get('versions');
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Unawaited promise in containerd compatibility check hook

Medium Severity

lando.engine.getCompatibility().then(...) is called without await, so the promise is fire-and-forget. The cache and lando.versions updates may not complete before downstream code reads them, leading to stale or missing version/compatibility data. The equivalent Docker hook (lando-get-compat.js) likely has the same pattern, but this is a new introduction that could cause race conditions with containerd-specific version checks.

Fix in Cursor Fix in Web

}
}
};
32 changes: 32 additions & 0 deletions hooks/lando-setup-containerd-engine-check.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
"use strict";

Check failure on line 1 in hooks/lando-setup-containerd-engine-check.js

View workflow job for this annotation

GitHub Actions / lint (ubuntu-24.04, 20)

Strings must use singlequote

Check failure on line 1 in hooks/lando-setup-containerd-engine-check.js

View workflow job for this annotation

GitHub Actions / docs-tests (ubuntu-24.04, 20)

Strings must use singlequote

Check failure on line 1 in hooks/lando-setup-containerd-engine-check.js

View workflow job for this annotation

GitHub Actions / npm (20)

Strings must use singlequote

const fs = require("fs");

Check failure on line 3 in hooks/lando-setup-containerd-engine-check.js

View workflow job for this annotation

GitHub Actions / lint (ubuntu-24.04, 20)

Strings must use singlequote

Check failure on line 3 in hooks/lando-setup-containerd-engine-check.js

View workflow job for this annotation

GitHub Actions / docs-tests (ubuntu-24.04, 20)

Strings must use singlequote

Check failure on line 3 in hooks/lando-setup-containerd-engine-check.js

View workflow job for this annotation

GitHub Actions / npm (20)

Strings must use singlequote
const os = require("os");

Check failure on line 4 in hooks/lando-setup-containerd-engine-check.js

View workflow job for this annotation

GitHub Actions / lint (ubuntu-24.04, 20)

Strings must use singlequote

Check failure on line 4 in hooks/lando-setup-containerd-engine-check.js

View workflow job for this annotation

GitHub Actions / docs-tests (ubuntu-24.04, 20)

Strings must use singlequote

Check failure on line 4 in hooks/lando-setup-containerd-engine-check.js

View workflow job for this annotation

GitHub Actions / npm (20)

Strings must use singlequote
const path = require("path");

Check failure on line 5 in hooks/lando-setup-containerd-engine-check.js

View workflow job for this annotation

GitHub Actions / lint (ubuntu-24.04, 20)

Strings must use singlequote

Check failure on line 5 in hooks/lando-setup-containerd-engine-check.js

View workflow job for this annotation

GitHub Actions / docs-tests (ubuntu-24.04, 20)

Strings must use singlequote

Check failure on line 5 in hooks/lando-setup-containerd-engine-check.js

View workflow job for this annotation

GitHub Actions / npm (20)

Strings must use singlequote

module.exports = async (lando) => {

Check failure on line 7 in hooks/lando-setup-containerd-engine-check.js

View workflow job for this annotation

GitHub Actions / lint (ubuntu-24.04, 20)

Unexpected parentheses around single function argument

Check failure on line 7 in hooks/lando-setup-containerd-engine-check.js

View workflow job for this annotation

GitHub Actions / docs-tests (ubuntu-24.04, 20)

Unexpected parentheses around single function argument

Check failure on line 7 in hooks/lando-setup-containerd-engine-check.js

View workflow job for this annotation

GitHub Actions / npm (20)

Unexpected parentheses around single function argument
const engine = lando.config.engine || "auto";
// Only check when engine is explicitly containerd
if (engine !== "containerd") return;

const userConfRoot = lando.config.userConfRoot || path.join(os.homedir(), ".lando");
const binDir = path.join(userConfRoot, "bin");

const missing = [];
const bins = {
containerd: lando.config.containerdBin || path.join(binDir, "containerd"),
nerdctl: lando.config.nerdctlBin || path.join(binDir, "nerdctl"),
buildkitd: lando.config.buildkitdBin || path.join(binDir, "buildkitd"),
};

for (const [name, binPath] of Object.entries(bins)) {
if (!fs.existsSync(binPath)) missing.push(name);
}

if (missing.length > 0) {
lando.log.warn(
"containerd engine selected but missing binaries: %s. Run \"lando setup\" to install them.",
missing.join(", "),
);
}
};
108 changes: 108 additions & 0 deletions hooks/lando-setup-containerd-engine.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
"use strict";

const fs = require("fs");
const os = require("os");
const path = require("path");

module.exports = async (lando, options) => {
const debug = require("../utils/debug-shim")(lando.log);
const {color} = require("listr2");
const getUrl = require("../utils/get-containerd-download-url");
const axios = require("../utils/get-axios")();

// Only run for containerd or auto engine selection
const engine = lando.config.engine || "auto";
if (engine === "docker") return;

const userConfRoot = lando.config.userConfRoot || path.join(os.homedir(), ".lando");
const binDir = path.join(userConfRoot, "bin");

// Binary definitions
const binaries = [
{
name: "containerd",
id: "setup-containerd",
bin: lando.config.containerdBin || path.join(binDir, "containerd"),
version: "2.0.4",
tarballEntry: "bin/containerd",
},
{
name: "buildkitd",
id: "setup-buildkitd",
bin: lando.config.buildkitdBin || path.join(binDir, "buildkitd"),
version: "0.18.2",
tarballEntry: "bin/buildkitd",
dependsOn: ["setup-containerd"],
},
{
name: "nerdctl",
id: "setup-nerdctl",
bin: lando.config.nerdctlBin || path.join(binDir, "nerdctl"),
version: "2.0.5",
tarballEntry: "bin/nerdctl",
dependsOn: ["setup-buildkitd"],
},
];

for (const binary of binaries) {
const url = getUrl(binary.name === "buildkitd" ? "buildkit" : binary.name, {version: binary.version});

const task = {
title: `Installing ${binary.name}`,
id: binary.id,
description: `@lando/${binary.name} (containerd engine)`,
version: `${binary.name} v${binary.version}`,
hasRun: async () => fs.existsSync(binary.bin),
canRun: async () => {
if (engine === "auto") {
// In auto mode, skip containerd setup if Docker is already working
try {
if (lando.engine && lando.engine.dockerInstalled) return false;
} catch {}
}
await axios.head(url);
return true;
},
task: async (ctx, task) => {
// Download the tarball
const tmpDir = path.join(os.tmpdir(), `lando-${binary.name}-${Date.now()}`);
fs.mkdirSync(tmpDir, {recursive: true});
fs.mkdirSync(binDir, {recursive: true});

await new Promise((resolve, reject) => {
const download = require("../utils/download-x")(url, {
debug,
dest: path.join(tmpDir, `${binary.name}.tar.gz`),
});
download.on("done", resolve);
download.on("error", reject);
download.on("progress", progress => {
task.title = `Downloading ${binary.name} ${color.dim(`[${progress.percentage}%]`)}`;
});
});

// Extract the specific binary from the tarball
task.title = `Extracting ${binary.name}...`;
const {execSync} = require("child_process");
execSync(
`tar -xzf "${path.join(tmpDir, binary.name + ".tar.gz")}" -C "${tmpDir}" "${binary.tarballEntry}"`,
{stdio: "pipe"},
);

// Move to bin dir
const extracted = path.join(tmpDir, binary.tarballEntry);
const dest = binary.bin;
fs.copyFileSync(extracted, dest);
require("../utils/make-executable")([dest]);

// Cleanup temp
fs.rmSync(tmpDir, {recursive: true, force: true});

task.title = `Installed ${binary.name} to ${dest}`;
},
};

if (binary.dependsOn) task.dependsOn = binary.dependsOn;
options.tasks.push(task);
}
};
Loading
Loading