Skip to content

Commit 3c91010

Browse files
authored
Merge branch 'main' into sql-import-drop
2 parents ed53297 + 4b72dad commit 3c91010

21 files changed

+250
-49
lines changed

CHANGELOG.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,31 @@
1-
## Unreleased
1+
## {{ UNRELEASED_VERSION }} - [{{ UNRELEASED_DATE }}]({{ UNRELEASED_LINK }})
22

3+
## v3.21.0-beta.19 - [May 9, 2024](https://github.com/lando/core/releases/tag/v3.21.0-beta.19)
4+
5+
### New Features
6+
7+
* Added ability to autostart Docker Desktop for Windows from within WSL instances [#164](https://github.com/lando/core/pull/164)
8+
* Improved method for locating and starting Docker Desktop on Windows [#164](https://github.com/lando/core/pull/164)
9+
* Updated default Docker Compose version to `2.27.0`
10+
* Updated default Docker Desktop version to `4.30.0`
11+
* Updated default Docker Engine version to `26.1.1`
12+
* Updated tested Docker Desktop range to `<=4.30`
13+
* Updated tested Docker Engine range to `<27`
314
* Updated `sql-export.sh` to use `mariadb-dump` command (if available). [#148](https://github.com/lando/core/pull/148)
415
* Added `leia` tests for `sql-import.sh` and `sql-export.sh`
516

17+
### Bug Fixes
18+
19+
* Fixed bug that caused Lando to be too impatient when starting Docker Desktop [#164](https://github.com/lando/core/pull/164)
20+
* Fixed unclear error when cancelling certain prompts
21+
22+
### Internal
23+
24+
* Added `buildkit` as an alias for `buildx` in `l337` service `image` key
25+
* Changed `download-x` to prefer `ipv4` [#165](https://github.com/lando/core/pull/165)
26+
* Changed `rebuild` to `kill` instead of `stop`
27+
* Improved error handling on `download-x` [#165](https://github.com/lando/core/pull/165)
28+
629
## v3.21.0-beta.18 - [April 29, 2024](https://github.com/lando/core/releases/tag/v3.21.0-beta.18)
730

831
* Fixed bug that prevented password prompts from rendering

components/l337-v4.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ class L337ServiceV4 extends EventEmitter {
105105
// set top level required stuff
106106
this.id = id;
107107
this.appRoot = appRoot;
108-
this.buildx = true;
108+
this.buildkit = true;
109109
this.config = config;
110110
this.context = context;
111111
this.debug = debug;
@@ -208,8 +208,8 @@ class L337ServiceV4 extends EventEmitter {
208208
// if we have a custom tag then set that
209209
if (data.tag) this.tag = data.tag;
210210

211-
// finally make sure we honor buildx disabling
212-
if (require('../utils/is-disabled')(data.buildx ?? this.buildx)) this.buildx = false;
211+
// finally make sure we honor buildkit disabling
212+
if (require('../utils/is-disabled')((data.buildkit || data.buildx) ?? this.buildkit)) this.buildkit = false;
213213
}
214214

215215
// just pushes the compose data directly into our thing
@@ -467,7 +467,7 @@ class L337ServiceV4 extends EventEmitter {
467467
this.sshKeys = [...new Set(this.sshKeys.concat(keys))];
468468
}
469469

470-
// add/merge in ssh stuff for buildx
470+
// add/merge in ssh stuff for buildkit
471471
addSSH(ssh) {
472472
// if ssh is explicitly true then that implies agent true and keys true
473473
if (ssh === true) ssh = {agent: true, keys: true};
@@ -499,7 +499,7 @@ class L337ServiceV4 extends EventEmitter {
499499
// set state
500500
this.state = {IMAGE: 'BUILDING'};
501501
// run with the appropriate builder
502-
const success = this.buildx ? await bengine.buildx(imagefile, context) : await bengine.build(imagefile, context);
502+
const success = this.buildkit ? await bengine.buildx(imagefile, context) : await bengine.build(imagefile, context); // eslint-disable-line max-len
503503
// augment the success info
504504
success.context = {imagefile, ...context};
505505
// add the final compose data with the updated image tag on success

config.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,21 @@ dockerSupportedVersions:
88
compose:
99
satisfies: "1.x.x || 2.x.x"
1010
recommendUpdate: "<=2.24.6"
11-
tested: "<=2.26.1"
11+
tested: "<=2.27.0"
1212
link:
1313
linux: https://docs.docker.com/compose/install/#install-compose-on-linux-systems
1414
darwin: https://docs.docker.com/desktop/install/mac-install/
1515
win32: https://docs.docker.com/desktop/install/windows-install/
1616
desktop:
1717
satisfies: ">=4.0.0 <5"
18-
tested: "<=4.29.0"
18+
tested: "<=4.30.0"
1919
recommendUpdate: "<=4.28.0"
2020
link:
2121
darwin: https://docs.docker.com/desktop/install/mac-install/
2222
win32: https://docs.docker.com/desktop/install/windows-install/
2323
engine:
2424
satisfies: ">=18 <27"
25-
tested: "<=26.0.0"
25+
tested: "<=26.1.1"
2626
link:
2727
linux: https://docs.docker.com/engine/install/debian/#install-using-the-convenience-script
2828

docs/lando-service.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Generally you will want to use a more specific service like `type: php` but this
1313
* Using Docker Compose config from other projects
1414
* Need a service not currently provided by Lando itself
1515

16-
It implements a super-set of the [Docker Compose Version 3 Spec](https://docs.docker.com/compose/compose-file/compose-file-v3/) and _usually_ requires some [slight tweaks](#caveats) of existing Docker Compose configuration to work correctly.
16+
It implements a super-set of the [Docker Compose Version 3 Spec](https://docs.docker.com/compose/compose-file/) and _usually_ requires some [slight tweaks](#caveats) of existing Docker Compose configuration to work correctly.
1717

1818
Here is a birds-eye view of all its options:
1919

@@ -27,7 +27,7 @@ services:
2727
type: lando
2828

2929
# these directly map to docker compose things
30-
# see: https://docs.docker.com/compose/compose-file/compose-file-v3/
30+
# see: https://docs.docker.com/compose/compose-file/
3131
# note that these are only available if you invoke the service directly
3232
services: {}
3333
networks: {}
@@ -51,7 +51,7 @@ services:
5151
5252
## Services, Networks, Volumes
5353
54-
These three: `services,` `networks` and `volumes` map directly to the [Docker Compose Version 3 Spec](https://docs.docker.com/compose/compose-file/compose-file-v3/) which means that the below is a valid Landofile:
54+
These three: `services,` `networks` and `volumes` map directly to the [Docker Compose Version 3 Spec](https://docs.docker.com/compose/compose-file/) which means that the below is a valid Landofile:
5555

5656
**Landofile**
5757
```yaml
@@ -351,7 +351,7 @@ Since [Lando 3.14.0](https://github.com/lando/lando/releases/tag/v3.14.0) servic
351351

352352
## Overrides
353353

354-
Lando services are just an abstraction layer on top of the [Docker compose v3 file format](https://docs.docker.com/compose/compose-file/compose-file-v3/). What this means is that behind the scenes your Landofile is being translated into a *SHLOAD* of *SUPERNASTY* looking `docker-compose` files which are then being used to power your app.
354+
Lando services are just an abstraction layer on top of the [Docker compose v3 file format](https://docs.docker.com/compose/compose-file/). What this means is that behind the scenes your Landofile is being translated into a *SHLOAD* of *SUPERNASTY* looking `docker-compose` files which are then being used to power your app.
355355

356356
We give you access to the Docker Compose layer with the `overrides` key.
357357

docs/services/l337.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ The `l337` service is the lowest level `api: 4` service and it implements **L**a
1414

1515
In high level terms it combines _service orchestration_ and _image specification_ into a single file format.
1616

17-
Specifically, it is a light superset around the [Docker Compose Version 3](https://docs.docker.com/compose/compose-file/compose-file-v3/) format that also uses the [Dockerfile](https://docs.docker.com/engine/reference/builder/) specification.
17+
Specifically, it is a light superset around the [Docker Compose Version 3](https://docs.docker.com/compose/compose-file/) format that also uses the [Dockerfile](https://docs.docker.com/engine/reference/builder/) specification.
1818

1919
This means that you _should_ be able to paste Docker Compose and/or Dockerfile compatible contents into your Landofile, add `api: 4` to each service and have it "just work".
2020

@@ -103,7 +103,7 @@ services:
103103
image:
104104
imagefile: "nginx:1.21"
105105
tag: "pirog/nginx:1.21"
106-
buildx: true
106+
buildkit: true
107107
ssh: false
108108
args:
109109
vibe: rising
@@ -194,7 +194,7 @@ services:
194194

195195
Array formatted `key=value` pairs are trimmed in both `key` and `value`. Args with no `value` are ignored as in `something` above.
196196

197-
### Buildx
197+
### Buildkit
198198

199199
If _for some reason_ you prefer to use the old pre-BuildKit image builder you can toggle this to `false`.
200200

@@ -205,13 +205,13 @@ services:
205205
# use the legacy builder
206206
example-1:
207207
api: 4
208-
buildx: false
208+
buildkit: false
209209
type: l337
210210
image:
211211
imagefile: nginx:1.21
212212
```
213213

214-
Note that if you do `buildx: false` some image build features, specifically those in [Dockerfile 1.1.0+](https://docs.docker.com/build/dockerfile/release-notes/#110) and the [ssh](#ssh) features of this service, may not be available.
214+
Note that if you do `buildkit: false` some image build features, specifically those in [Dockerfile 1.1.0+](https://docs.docker.com/build/dockerfile/release-notes/#110) and the [ssh](#ssh) features of this service, may not be available. You can also use `buildx` as an alias for `buildkit`. If you use both it will evaluate to `true` if either is `true`. Really just don't use both ;)!
215215

216216
You probably should just ignore this setting unless you have a well understood reason to do otherwise.
217217

@@ -430,7 +430,7 @@ lando rebuild
430430
Here are some additional notes on this feature:
431431

432432
* Passphrase protected keys can be used but only if added to your host `ssh-agent` _before_ image build
433-
* This feature is not available if you set `buildx: false`
433+
* This feature is not available if you set `buildkit: false`
434434
* The keys/agent are only available when explicitly mounted in a `RUN` instruction they **DO NOT** end up in the resulting image
435435

436436
### Steps

examples/l337/.lando.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,51 @@ services:
146146
owner: "nginx:nginx"
147147
permissions: "775"
148148

149+
# buildkit features
150+
buildkit:
151+
api: 4
152+
type: l337
153+
image:
154+
buildkit: true
155+
ssh: true
156+
imagefile: |
157+
# syntax=docker/dockerfile:1.7
158+
ARG VERSION=bookworm
159+
FROM alpine AS build-env
160+
WORKDIR /app
161+
RUN touch /app/me
162+
163+
FROM debian:$VERSION
164+
ARG VERSION
165+
166+
RUN echo $VERSION > image_version
167+
RUN <<EOF
168+
apt-get update
169+
apt-get install -y curl git
170+
EOF
171+
RUN mkdir -p -m 0600 ~/.ssh && ssh-keyscan github.com >> ~/.ssh/known_hosts
172+
RUN --mount=type=ssh,id=keys git clone [email protected]:lando/lando.git /tmp/lando
173+
RUN --mount=type=ssh,id=agent git clone [email protected]:lando/lando.git /tmp/more-lando
174+
175+
# these are not universally supported yet
176+
# ADD --keep-git-dir=true https://github.com/moby/buildkit.git#v0.10.1 /buildkit
177+
# ADD --checksum=sha256:24454f830cdb571e2c4ad15481119c43b3cafd48dd869a9b2945d1036d1dc68d https://mirrors.edge.kernel.org/pub/linux/kernel/Historic/linux-0.01.tar.gz /tmp
178+
179+
COPY * /tmp
180+
COPY --from=build-env /app /app2
181+
COPY --chown=55:mygroup file* /tmp/files
182+
COPY --chown=bin file* /tmp/files2
183+
COPY --chown=1 file* /tmp/files3
184+
COPY --chown=10:11 file* /tmp/files3
185+
COPY --chown=myuser:mygroup --chmod=644 file* /tmp/files4
186+
187+
CMD sleep infinity
188+
context:
189+
- source: "file1"
190+
destination: "/file7"
191+
owner: "nginx:nginx"
192+
permissions: "775"
193+
149194
# build-arg features
150195
build-args-1:
151196
api: 4

hooks/lando-autostart-engine.js

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,17 @@ module.exports = async lando => {
88
const debug = require('../utils/debug-shim')(lando.log);
99
const tasks = [{
1010
title: 'It seems Docker is not running, trying to start it up...',
11-
retry: 25,
12-
delay: 1000,
11+
retry: {
12+
tries: 25,
13+
delay: 1000,
14+
},
1315
task: async (ctx, task) => {
14-
// prompt for password if interactive and we dont have it
15-
if (process.platform === 'linux' && lando.config.isInteractive) {
16+
// Prompt for sudo password if interactive and not Docker Desktop WSL2 integration
17+
if (
18+
process.platform === 'linux'
19+
&& lando.config.isInteractive
20+
&& !require('../utils/is-wsl-interop')(lando.engine.daemon.docker)
21+
) {
1622
ctx.password = await task.prompt({
1723
type: 'password',
1824
name: 'password',
@@ -38,6 +44,11 @@ module.exports = async lando => {
3844
}
3945
},
4046
}];
41-
await lando.runTasks(tasks, {listrOptions: {exitOnError: true}});
47+
await lando.runTasks(tasks, {
48+
listrOptions: {exitOnError: true},
49+
rendererOptions: {
50+
pausedTimer: {condition: false},
51+
},
52+
});
4253
}
4354
};

hooks/lando-setup-build-engine-darwin.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ const semver = require('semver');
77
const {color} = require('listr2');
88

99
const buildIds = {
10+
'4.30.0': '149282',
1011
'4.29.0': '145265',
1112
'4.28.0': '139021',
1213
'4.27.2': '137060',

hooks/lando-setup-build-engine-win32.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ const {color} = require('listr2');
88
const {nanoid} = require('nanoid');
99

1010
const buildIds = {
11+
'4.30.0': '149282',
1112
'4.29.0': '145265',
1213
'4.28.0': '139021',
1314
'4.27.2': '137060',

lib/app.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ module.exports = class App {
400400
*/
401401
.then(() => this.events.emit('pre-rebuild'))
402402
// Stop app.
403-
.then(() => this.stop())
403+
.then(() => this.stop(true))
404404
// Uninstall app
405405
.then(() => this.uninstall())
406406
// Repull/build components.
@@ -526,9 +526,10 @@ module.exports = class App {
526526
* @alias app.stop
527527
* @fires pre_stop
528528
* @fires post_stop
529+
* @param {Boolean} kill - Kill instead of stop
529530
* @return {Promise} A Promise.
530531
*/
531-
stop() {
532+
stop(kill = false) {
532533
// Stop it!
533534
this.log.info('stopping app...');
534535
return initAndReport(this, 'stop')
@@ -543,7 +544,7 @@ module.exports = class App {
543544
.then(() => this.events.emit('pre-stop'))
544545

545546
// Stop components.
546-
.then(() => this.engine.stop(this))
547+
.then(() => this.engine.stop({...this, kill}))
547548

548549
/**
549550
* Event that runs after an app stop.

0 commit comments

Comments
 (0)