Newbe question: How to force a specific distro to be used by Docker?

I’m just starting with Docker and trying to understand how this all works. After reading through several docs and posts there is this question, I couldn’t find an answer for.

  • I activated WSL support on my Windows machine.
  • I installed an Ubuntu distro from the MS store and made it default.
  • I added Docker support to my ASP.NET Core web api app and started debugging using Docker, which worked flawlesy.

Now when I check the distro inside the Docker Image, it is always Debian and I cannot find a way to make Docker use of the Ubuntu, I installed previeously.
Question: How do I force Docker to use Ubuntu?
Secondly, does that matter at all or is it completly unimportant on what Distro the image runs?
If yes, what for did I install the Ubuntu Disztro from the store?

Hope this all makes sense…

Thanks for any answers
Thomas

You are mixing things up here. There are two linux distros to take a look at.
First your WLS distro. You need a WSL distro because docker relies heavily on linux kernel features and thus will never run natively on windows. Thats why you need a VM (basically what WSL is, a fancy VM).
The second image is the image of the docker container, which is not bound to your hosts distro.

Your can run debian containers on ubuntu or ubuntu container on arch linux, it really doesn’t matter.

It kinda is. The choice of distro for your container (not the host) is only influenced by what features you want inside of the container. The ASP.NET team decided that debian is a good choice for their container and thus they used it. They probably could have used ubuntu too.

Just to get docker running.

You don’t. If you really really want to change the images distro, you have to create your own image using a Dockerfile or be lucky that the maintainer of the image provides multiple versions with different base distros.

Thanks, I already suspected to mix things up here.
So then I can get rid of that Ubuntu stuff since the Docker thingy worked already before I doenloaded it?

Dein Username lässt vermurten, dass du Deutscher bist, also nochmal vielen Dank!

Regards
Thomas

If you mean your WSL distro, then the answer is if you want to. Docker destkop also works without WSL but since you have it setup already you can also continue using it.

In der Tat :slight_smile: