Docker Community Forums

Share and learn in the Docker community.

Trying to understand Linux path names in Docker for Windows

I have wanted to use Docker for a long time now but each time I try I get way too confused by the file paths and now I still have no idea how to use Docker but I desperately want to, so can someone please help me out?

First off, I am running Windows11, not Windows server (that seems to be a thing so I thought I’d just mention that). What I want to do is run XAMPP but load my personal development OR my work related stuff both using “localhost” without having to create virtual hosts.

I see Docker allows for the creation of volumes to store persistent data and that sounds awesome so I create my first volume and when I inspect it I see it is located at “/var/lib/docker/volumes/mydata/_data” but that path… where the heck is that path on my PC? how do I place anything in there?

This is the same question I have with installing XAMPP via Docker rather than natively on Windows directly. I see that to install XAMPP is easy as can be. just pull it, start it, job done… except that I must start it and specify where my files are stored. I must specify that as a Linux file path like ~/myfiles/index.php but my files are at D:\xampp\htdocs so how do I tell this Linux XAMPP where my files are in my Windows filesystem?

The same is true with trying to create my own Dockers. I wanted to use Windows dockers but when I went to the hub I see there is a grand total of like 4 Dockers and definitely no XAMPP. This means I have no place to start from but, that is okay, I can just create my own, right? So I follow the guides I see online and they just show how to add Linux folders to a Docker. How do I run the XAMPP installer and tell it to install into the Docker image, not my C drive? Must I just install it into my C: and then somehow move the files from my C: into a docker image? What about registry entries? How does Windows Docker images handle registry entries?

Specifically, I have a couple of service that starts up with Windows as I need that for work but I don’t want it to run ALL the time since I am not always working. So can I install apps inside a docker and have it only start when I say and then stop when I say? Again, what about registry entries? So Windows dockers are just too complicated and I see why there is only 4 in all of existence.

So I am back to Linux dockers and back to not knowing where any of the items I download are stored and inspecting them gives me file paths that don’t exist in my Windows filesystems and then when I create my own volumes, they also tell me to look for them in folders that don’t exist in my Windows filesystem

So, question 1: where exactly does all the docker images I download get stored?
Question 2: Where do the volumes I create get stored?
Question 3: How do I add my website files to a volume?
Question 4: How do I start the Linux XAMPP docker and tell it to map Linux /www to Windows D:\XAMPP\htdocs