DEV Community

Discussion on: A Guide to Installing the Windows Subsystem for Linux (WSL) and Windows Terminal

Collapse
 
manierim profile image
Marco Manieri

My current dev environment is docker run under WSL 2. So it's using Linux containers.

Images I use/build are all Linux based (mostly on Alpine). They run much much more efficient than running docker under Windows (Windows containers that have to host Linux based images).

I mainly develop in php (Laravel) with specific image builds for each project (php versions, extensions, os packages, etc) plus support images for services (DBs, cache systems, web servers, etc). In most cases all organized per project in docker-compose dev files.

Also I mainly use VS Code that integrates very nicely with docker "dev" containers, running its server components in the image itself and then communicating with the "client" (UI) running on Windows. So things like linting, git are much more responsive and lean than under Windows containers.

This setup has greatly improved my docker-based workflow. Unit tests (phpunit) run much faster than with docker directly under Windows. Same for DBs and all other supporting images.

It also made much quicker to switch working between different projects. Containers are up in a fraction of the time they were under Windows, and that was already faster than starting VMs prior to switching to Docker.

If your workflow resembles mine I strongly suggest to investigate about proper setting of WSL 2 on your Windows machine.

It's true that there are a few potential hiccups. I had not experienced any major problem, but there are some often reported. If you happen to not encounter them or success in fixing them it might be very worth!

And finally my experience is very good also in regard to Windows Terminal, default profile is the Ubuntu one with start directory my "code" dir ready to CD into the project folder, fire up the containers and log into the dev one... Very quick, clean and efficient

Collapse
 
voracious profile image
David R. Myers • Edited

Glad to hear you are enjoying this setup! I am also a fan, and I plan to do a follow-up article for getting Docker setup with WSL 2. That being said, you raised a good point about the default directory for the Linux terminal, so I am going to update the article with instructions for that change! Thanks!

Edit: the article has been updated.