lando / core

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

Docker issues on WSL when Docker Desktop integration is disabled #181

Open AaronFeledy opened 4 days ago

AaronFeledy commented 4 days ago

Do I have this issue?

What's the workaround?

The problem

Repro

Suggested Fix

pirog commented 4 days ago

@AaronFeledy my take on this, FWIW, is that it's probably not great to force on a setting a user has purposefully disabled.

I feel like it would be best to improve lando so that the usual linux docker setup runs in WSL2 when the integration is disabled?

AaronFeledy commented 4 days ago

@pirog Yeah, picking the best default behavior gets tricky:

If they have Docker Desktop installed, they probably are already using it and want to continue using it. It's what's recommended by Docker and should probably also be our recommendation.

It's easy to get into a situation where the integration was never enabled for your WSL instance, even if you want it (or don't know you want it) such as when creating a WSL instance that is not marked as the default. (DD only enables integration for the default WSL instance).

I've had issues where I've had docker installed inside a WSL instance and then later indirectly enabled DD integration by telling WSL to start considering it my default instance. Then you get inconsistent behavior because starting Docker Desktop will symlink the integration bins into your WSL instance only while Docker Desktop is started. If you haven't started Docker Desktop yet that day or it crashes, the docker you installed inside the instance gets used instead. My concern is that if a user doesn't know the how/what/why of the integration, we may unintentionally create problems for them.

If the user is actually trying to keep things separate (often mistakenly thinking there's a performance benefit) and has deliberately chosen to disable the integration, then we could install docker. I don't think we can automatically determine their intent though. I think this is an advanced use case and there are WSL-specific ways to disable interoperability if their goal is to actually keep things separated. In which case, Lando setup won't see Docker Desktop and will just install it as expected.

Perhaps we can recommend the Docker Desktop integration approach but also add a flag to the lando setup command that allows them to signal their intent and force the docker install.