Hi! My question is that I have a server that can only run on a windows machine and I need a mysql server as a database. How can I manage to run two containers at the same time where one is windows and the other is linux based?
tried experimental, but the newer version no longer supports it
I’ve also looked at swarm but I don’t see how that would work because you have to set the IP on separate machines as I looked.
How would you make it work ? So the goal would be to have two containers in a docker desktop running on a windows operating system, one windows and one linux, running at the same time and networking between them so they can communicate with each other.
If the docker desktop can’t do that, I’d be interested in a docker solution, so if you had to do one, how would you do it?
I have looked on many sites and none of the ones I have tried work so I would like to ask for your help.
Linux containers need Linux host, Windows containers need Windows host. There was indeed an experimental way called lcow which you probably refered to and WSL2 replaced it as far as I know.
You could run Windows containers and switch to Linux containers, run Linux containers (from the GUI or change context from terminal) and you should be able to run both containers at the same time, but they will not have a common network as one will run in a Linux VM, the other will either have process isolation on Windows or run on top of HyperV if the container version is not compatible with the Windows version.
I have to mention that Docker Desktop is not officially supported on servers and never was. Microsoft has a documentation about alternatives
Hi! Thank you for your quick reply. Yes I have checked this GUI switching between linux and windows and yes as I wrote before and as you wrote now it does not support running both containers at the same time.
By server I mean that I want to create a dev server on localhost with the docker desktop so it would not run on a server machine but on my own computer.
Can you suggest something that can be done or is it not possible and I should rather have the server running on localhost and mysql running in docker?
So it is not possible to run the two together in any way?
All I was saying is that you can’t have a common network, but you can still connect to the forwarded ports on the host’s IP address. You can also use the host.docker.internal domain name from containers in Docker Desktop to connect to a port on localost if it is forwarded to a container. I never tried that domain to make connection between windows and Linux containers so I don’t know if it works from Windows containers or not.