Search code examples
linuxwindowsdockercontainers

Can a Docker container with a Linux base image run in Windows?


I do not have much experience with Docker and would really appreciate some guidance on a concern of mine. I wish to create a containerized ML Model that takes in some data from a local file, runs some analysis and returns results. The system that this container runs on would be a Windows PC. My concerns are:

  1. If I create a Linux based image for this ML model app, will it work on the windows pc ? Would installing WSL-2 facilitate it?

  2. Even if it does, is the version of Windows important in this case ?

I have not actually tried this out because I wanted some initial advice on what is possible. Thank you in advance for any help and please do tell me if additional info is required!


Solution

  • You can run linux based containers with Docker for Windows with WSL 2 enabled.

    Docker Desktop usually automatically installs/enables WSL on install. If not, you can setup WSL2 manually: https://learn.microsoft.com/en-us/windows/wsl/install