THIS is the video you need if you need to run Linux containers on WSL. Setup Docker on Windows using the docker binaries, and setup docker inside of the default distro running on WSL. setup the json file on windows and place in c:\programdata\docker\config, and then point the IP address within it to the hostIP 127.0.0.X of the WSL-Ubuntu hostIP address... and then BAM you got yourself a Windows Docker daemon service pointing to a Linux Docker backend. My goal is to have a headless Windows 10 machine running my containers, automated so they start as soon as the computer turns back on from a restart without doing things like logging into a user account, or installing NSSM, or auto locking a user account after it logs in. THANK YOU for this video!! I'm about half way thru the video and I'll say this, this is as far as I've gotten on non-Windows server installing and running Docker on Windows without Docker Desktop.
Awesome! Was able to get the environment up and running. Is there a way for Portainer to see/manage both the Linux and HyperV containers? Can the Linux and HyperV containers cooperate/communicate like a docker-compose group?
Sure you can. In portainer select 'Environments' from the left menu. Then 'Add Environment'. Select 'docker standalone', 'start wizard' then select 'API' option. for the Name use anything you like, for the API URL use the windows machine ip address and the port docker is running on (2376 in my tutorial). click 'connect' and your windows docker is not visible inside portainer. As for these communicating with eachother as long as the firewalls allow access to the ports you are exposing, then you should be able to call a windows container from a wsl container or vice versa. Good luck.
I'd like to see/know if one can use this setup to do container-based sw dev with vscode (i.e. vscode client running in Windows and vscode server running in container), given the necessary vscode extensions are installed?
You can't (ref: stackoverflow.com/questions/70332824/running-linux-container-in-windows) the container relies on the underlying OS, so a linux container must run on a linux OS. 'does it in the background' sounds like a windows service might fit? or an application that runs at windows startup / user login, or you could use the windows task scheduler to start your application on an event or given time period - lots of options that wouldn't require containerisation.
Do you know what needs to be done to get visual studio to happily build a linux container using the wsl docker daemon. Currently falls over in vs but fine from cli using docker build. Error in vs: "error response from daemon: invalid mode: /src/.
@thepragmaticprogrammer hmm I tried posting a reply a little while back, it had a url in it so maybe TH-cam blocks that... basically i got a bit further. The docker run command that visual studio is running contains volumes mounts if I copy paste that to a terminal it also fails for me, something about invalid volume mount specification. I've posted my details to the visual studio dev community feedback site. That was the link I tried to share. I got the command to work manually changing how the paths were being formatted. But I'm stuck figuring out how to tell vs to do that natively. It must be possible because when docker desktop is installed this magically works!
I don't get the reference to the license for docker for desktop on why that's an issue - as I understand it, there is only a license fee if your organization has at least 250 employees AND $10 Million in annual revenue. If you have < 250 employees or less than $10 million in revenue it is open source license with no fees.
I think you have answered your own question. Many people work for large global corporations and fall into this category. However, it can be hard or even impossible to convince budget holder(s) to spend money on IT licenses in these cost conscious times we live in. This can leave developers in a tricky situation.
@@thepragmaticprogrammer What is it - $24/user/mo for the highest fee? $288 per developer might seem high if you have a lot of developers, if you don't have a lot of developers it's $60 or $108 per user, depending on Pro or Team license. A manager worth his salt can easily hide these under licensing fees without much difficulty. However, it's never a bad thing to look at alternative solutions that may be as good, or even better. Personally, I like the looks of portainer better.
@@rockymarquiss8327 Let's just say that big companies can be fucking stupid. I was offered the newest macbook pro so that I could switch to use OrbStack instead of docker desktop to save those $24 fees...
THIS is the video you need if you need to run Linux containers on WSL. Setup Docker on Windows using the docker binaries, and setup docker inside of the default distro running on WSL. setup the json file on windows and place in c:\programdata\docker\config, and then point the IP address within it to the hostIP 127.0.0.X of the WSL-Ubuntu hostIP address... and then BAM you got yourself a Windows Docker daemon service pointing to a Linux Docker backend. My goal is to have a headless Windows 10 machine running my containers, automated so they start as soon as the computer turns back on from a restart without doing things like logging into a user account, or installing NSSM, or auto locking a user account after it logs in. THANK YOU for this video!!
I'm about half way thru the video and I'll say this, this is as far as I've gotten on non-Windows server installing and running Docker on Windows without Docker Desktop.
Thank you very much for this. Easy step-by-step instructions. Up and running in no time.
Awesome! Was able to get the environment up and running. Is there a way for Portainer to see/manage both the Linux and HyperV containers? Can the Linux and HyperV containers cooperate/communicate like a docker-compose group?
Sure you can. In portainer select 'Environments' from the left menu. Then 'Add Environment'. Select 'docker standalone', 'start wizard' then select 'API' option. for the Name use anything you like, for the API URL use the windows machine ip address and the port docker is running on (2376 in my tutorial). click 'connect' and your windows docker is not visible inside portainer.
As for these communicating with eachother as long as the firewalls allow access to the ports you are exposing, then you should be able to call a windows container from a wsl container or vice versa.
Good luck.
I'd like to see/know if one can use this setup to do container-based sw dev with vscode (i.e. vscode client running in Windows and vscode server running in container), given the necessary vscode extensions are installed?
How can you run a linux container but with only the windows docker , trying to make something where it does it in the background
You can't (ref: stackoverflow.com/questions/70332824/running-linux-container-in-windows) the container relies on the underlying OS, so a linux container must run on a linux OS.
'does it in the background' sounds like a windows service might fit? or an application that runs at windows startup / user login, or you could use the windows task scheduler to start your application on an event or given time period - lots of options that wouldn't require containerisation.
Great tutorial
Great job
Do you know what needs to be done to get visual studio to happily build a linux container using the wsl docker daemon. Currently falls over in vs but fine from cli using docker build. Error in vs: "error response from daemon: invalid mode: /src/.
Visual Studio or VSCode? for VSCode you need to install the wsl extension
@thepragmaticprogrammer hmm I tried posting a reply a little while back, it had a url in it so maybe TH-cam blocks that... basically i got a bit further. The docker run command that visual studio is running contains volumes mounts if I copy paste that to a terminal it also fails for me, something about invalid volume mount specification. I've posted my details to the visual studio dev community feedback site. That was the link I tried to share. I got the command to work manually changing how the paths were being formatted. But I'm stuck figuring out how to tell vs to do that natively. It must be possible because when docker desktop is installed this magically works!
I don't get the reference to the license for docker for desktop on why that's an issue - as I understand it, there is only a license fee if your organization has at least 250 employees AND $10 Million in annual revenue. If you have < 250 employees or less than $10 million in revenue it is open source license with no fees.
I think you have answered your own question. Many people work for large global corporations and fall into this category. However, it can be hard or even impossible to convince budget holder(s) to spend money on IT licenses in these cost conscious times we live in. This can leave developers in a tricky situation.
@@thepragmaticprogrammer What is it - $24/user/mo for the highest fee? $288 per developer might seem high if you have a lot of developers, if you don't have a lot of developers it's $60 or $108 per user, depending on Pro or Team license. A manager worth his salt can easily hide these under licensing fees without much difficulty.
However, it's never a bad thing to look at alternative solutions that may be as good, or even better. Personally, I like the looks of portainer better.
@@rockymarquiss8327 Let's just say that big companies can be fucking stupid. I was offered the newest macbook pro so that I could switch to use OrbStack instead of docker desktop to save those $24 fees...