Can I run WSL inside Windows Container?

%3CLINGO-SUB%20id%3D%22lingo-sub-95495%22%20slang%3D%22en-US%22%3ECan%20I%20run%20WSL%20inside%20Windows%20Container%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-95495%22%20slang%3D%22en-US%22%3E%3CP%3EDockerfile%3A%3C%2FP%3E%3CPRE%3EFROM%20microsoft%2Fwindowsservercore-insider%0A%0ASHELL%20%5B%22powershell%22%2C%20%22-Command%22%5D%0A%0ARUN%20Add-WindowsFeature%20Microsoft-Windows-Subsystem-Linux%3C%2FPRE%3E%3CPRE%3Edocker%20build%20-t%20wsl%20.%0Adocker%20run%20-it%20wsl%20powershell%3C%2FPRE%3E%3CPRE%3EPS%20C%3A%5C%26gt%3B%20hostname%0A1bbc92e30a1b%0APS%20C%3A%5C%26gt%3B%20get-win%0A%0APS%20C%3A%5Cdocker%26gt%3B%20docker%20ps%20-a%0A1bbc92e30a1b%20%20%20wsl%20%20%22powershell%22%20%20%20About%20a%20minute%20ago%20%20%20Exited%20(1073807364)%2018%20seconds%20ago%20%20%20%20%20heuristic_agnesi%3C%2FPRE%3E%3CP%3Eo_0%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EMfG%20Andrey.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-95495%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EContainers%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Highlighted
Visitor

Dockerfile:

FROM microsoft/windowsservercore-insider

SHELL ["powershell", "-Command"]

RUN Add-WindowsFeature Microsoft-Windows-Subsystem-Linux
docker build -t wsl .
docker run -it wsl powershell
PS C:\> hostname
1bbc92e30a1b
PS C:\> get-win

PS C:\docker> docker ps -a
1bbc92e30a1b   wsl  "powershell"   About a minute ago   Exited (1073807364) 18 seconds ago     heuristic_agnesi

o_0

 

MfG Andrey.

 

 

0 Replies