I did wonder that one of the biggest motivations for WSL 2 would be improved Docker support when building Linux images on Windows. Glad to report that this appears now to be seamless.
When building Linux Docker images on Windows this message would appear:
SECURITY WARNING: You are building a Docker image from Windows against a non-Windows Docker host. All files and directories added to build context will have '-rwxr-xr-x' permissions. It is recommended to double check and reset permissions for sensitive files and directories.
I noted earlier that Docker for Windows automatically detected the availability of WSL 2 and configured itself accordingly. I found that the
docker command was already available. Looking at the output of
htop it is clear that this is running a proxy with the Docker for Windows install.
/mnt/wsl/docker-desktop/docker-desktop-proxy --distro-name Ubuntu-20.04 --docker-desktop-root /mnt/wsl/docker-desktop
Testing this out, I can use WSL 2 to build Linux images that I am preparing in Windows, avoiding the warning shown earlier. However, the warning would be expected to still apply when using the Windows file-system. Access to the WSL file-system from Explorer is done via