Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Confused about why this beginner's Dockerfile works on Windows

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:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

<?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 ?

>Solution :

Yes, it’s using WSL2 to run Linux containers

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading