Developing in Windows with Docker and WSL2

Just wanted to start a quick topic to document some findings that came up while trying to help @shane_aldrich set up a local development environment on Windows with Windows Subsystem for Linux (WSL2) and the farmOS development Docker image.

For the most part, it seemed to work fine, but there were two small changes that needed to be made to WSL2 and Docker config:

  1. Change root = /windir/ to root = / in /etc/wsl.conf (per https://nickjanetakis.com/blog/setting-up-docker-for-windows-and-wsl-to-work-flawlessly#ensure-volume-mounts-work)
  2. Change {"credsStore":"desktop.exe"} to {"_credsStore":"desktop.exe"} in ~/.docker/config.json (per `docker-compose up` fails in WSL 2 environment · Issue #12355 · docker/for-win · GitHub)

Hopefully this helps others who might run into the same issues. Feel free to use this topic to discuss Windows development environments more generally!

1 Like