Posts

Showing posts from August, 2019

Running docker-compose against WSL2

Just adding a quick note for myself here. I wanted to run against docker host on WSL2 and docker compose connects to DockerDesktopVM instance by default (the full virtual machine). What I wanted to try is to run Docker Compose experience without the virtual machine utilizing the new WSL2 capabilities. Scott Hanselman has a good write-up about this feature. Prequisities Windows 10 insider build from the fast ring (at the time of writing), build 18932 or newer Enable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform Install Ubuntu 18.04 from Windows Store, ensure it has the correct WSL version wsl --set-version Ubuntu-18.04 2 To make life easier, make the new version default wsl --set-default-version 2 Install Docker Desktop WSL 2 Technical Preview Run docker-compose targeting the Linux WSL2 docker host The key is to use the -H parameter, when you are hosting both the Virtual Machine and lightweight WSL2 version. docker-compose -H "npipe:/