lando / core

Current Lando v3 runtime
https://docs.lando.dev/core/v3
GNU General Public License v3.0
4 stars 20 forks source link

allow passthrough of Docker/Buildkit CLI options #69

Open tobybellwood opened 9 months ago

tobybellwood commented 9 months ago

With docker compose v2, there are some underlying changes to how it performs builds (mostly around the use of buildkit if available).

In order to control these, in docker compose, we can use DOCKER_BUILDKIT=0 to disable, or BUILDKIT_PROGRESS=plain to show full build debug e.g.

BUILDKIT_PROGRESS=plain docker compose build

it would be good if we could somehow also pass these variables through Lando to aid with debugging/support. I know that you use ?dockerode to call the docker API - but no idea whether passing CLI options across is a thing

pirog commented 9 months ago

@tobybellwood we discussed this internally and here are some thoughts.

Currently it looks like Lando 3/Lando 3 services FORCE the use of BuildKit. So both Docker Compose 1/2 should be using buildkit when you try to "build" a Lando 3 service. I'm not sure it makes a ton of sense to allow this to change for Lando 3. For lagoon in particular i think we just want to set something like the below if the user is using the lagoon recipe.

process.env.DOCKER_BUILDKIT=0

We can also set process.env.BUILDKIT_PROGRESS=plain if the user has toggled on --debug|-vvv

Currently for Lando 4/Lando 4 services we DO NOT use buildkit because it hasnt been implemented in dockerode yet (see: https://github.com/apocas/dockerode/issues/601) however its something we WILL use at some point because it has some pretty useful things we want to use for build. that said, i think in that scenario we can make it configureable.

So a summary would be: good idea, agreed, probably will be a build engine setting in lando 4 when buildkit becomes available.

i'm going to keep this open for now until we are certain we dont want to do something for Lando 3 here. In the interim pinging @reynoldsalec to see if he has bandwidth to look at https://github.com/lando/lagoon/issues/53 as we probably just want to disable buildkit by default for lagoon?