Home > Net >  Confused about why this beginner's Dockerfile works on Windows
Confused about why this beginner's Dockerfile works on Windows

Time:04-18

I am using Windows 10, and I have WSL2 installed

I have installed Docker Desktop, and successfully built and run the following Dockerfile:

FROM php:7.2-apache
COPY src/ /var/www/html
EXPOSE 80

where /src has a simple index.php file as follows:

<?php
echo "Hello World";

When I go to localhost on my browser, it does show "Hello world", so everything works.

When I look on Docker Hub, I cannot actually see any tag against php that has Windows against it. I thought the image had to match the OS

So my question is: why does this work at all ? Is the software using WSL2 behind the scenes ?

CodePudding user response:

Yes, it's using WSL2 to run Linux containers

  • Related