docs/supported_docker_environment/windows.md
The following features are not available or do not work correctly so make sure you do not use them or use them with caution. The list may not be complete.
Using Docker for Windows with WSL2 backend should work out of the box.
However, there is an existing issue in WSL/WSL2 that effects certain older Docker images. The currently proposed workaround is to enable vsyscall emulation in the WSL2 kernel:
[wsl2]
kernelCommandLine = vsyscall=emulate
Testcontainers supports communicating with Docker for Windows within the Windows Subsystem for Linux (WSL). The following additional configurations steps are required:
Expose the Docker for Windows daemon on tcp port 2375 without TLS.
(Right-click the Docker for Windows icon on the task bar, click setting and go to General).
Set the DOCKER_HOST environment variable inside the WSL shell to tcp://localhost:2375.
It is recommended to add this to your ~/.bashrc file, so it’s available every time you open your terminal.
Optional - Only if volumes are required:
Inside the WSL shell, modify the /ect/wsl.conf file to mount the Windows drives on / instead of on /mnt/.
(Reboot required after this step).
Remember to share the drives, on which you will store your volumes, with Docker for Windows.
(Right-click the Docker for Windows icon on the task bar, click setting and go to Shared Drives).
More information about running Docker within the WSL can be found here.
Please report any issues with the Windows build of Testcontainers here and be sure to note that you are using this on Windows.