I want to use WSL in a a windows container. I want my shell to be bash.exe (from the Wsl feature) IN the dockerfile (i do NOT want msys2/relatives, but WSL 1)
I tried
FROM mcr.microsoft.com/windows:1903
RUN dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
With no success. Can someone hint me to the golden dockerfile ?
Using an ISO source file from microsoft.com, i have managed to find the missing "source files" and enable WSL feature.
But it requires a reboot (and kernel module files to be loaded) witch docker cannot do (AFAIK).
I think using WSL in dockerfile is impossible.
curl -L -o windows.iso https://software-download.microsoft.com/download/pr/17763.737.190906-2324.rs5_release_svc_refresh_SERVER_EVAL_x64FRE_en-us_1.iso
7z x "-i!sources/install.wim" windows.iso
7z x "-i!1/Windows/WinSxS" sources/install.wim
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /Source:"%cd%/1/Windows/WinSxS" /all /norestart
del windows.iso
rd /S /Q "sources"
rd /S /Q "1"
dir
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With