3

I'm new to docker. I want to run the ngnix server inside a windows container but the ngnix image is available only for Linux. So, I have switched to Linux containers on windows and created the container using that image and configured the port 80 of the container to my host port 8000.

it's working and I saw the ngnix index page. The problem is I want to move my static site to this container but when I created and mounted the volume to the container, the volume is created inside the mobilinux.

So, I want to push my static files sites to that volume where as in case of windows container the volume is create in the host machine file system I can inspect the volume using docker volume inspect <volumename> command and figure out the folder and I can able to place my code there. I need help to push my code in to the Linux container from windows host.

I can use bash inside the container and able to edit the html files after installing vim editor inside the container. But when I tried to connect to the mobilinux vm from hyper-v manager, I can't connect.

Naing Lin Aung
  • 3,373
  • 4
  • 31
  • 48

1 Answers1

4

You need to share your local drives (volumes) with Docker Desktop for Windows, so that they are available to your Linux containers.

Something like follows:

enter image description here

Then something like next will work:

docker run -idt -v C:/your_folder_on_windows:/your_folder_in_container nginx

You can just put code in C:/your_folder_on_windows, and will be ready in /your_folder_in_container of your container.

Details refer to official guide

atline
  • 28,355
  • 16
  • 77
  • 113