-2

I dont understand a couple things with docker on Windows.

I need to write a simple Dockerfile. I need to do this in VS Code to push it to my GitLab repository. And here is my problem: I need to use nginx image, but with my own .html part. I know I am suppose to do it with COPY instruction - something like COPY index.html path and... what path? where nginx looks in Windows? In linux is something like /usr/share/... but i can't find anything like this in WSL... Iam using Docker Desktop and WSL.

Please help my with this issue...

Skyeee
  • 69
  • 1
  • 7
  • Unless you've clicked on "Switch to Windows containers", your Nginx container **is** Linux. The destination path is inside the container. – Álvaro González Jan 05 '22 at 14:49
  • What does it mean "The destination path is inside the container"? I need path to images – Skyeee Jan 05 '22 at 15:07
  • As per [docs](https://docs.docker.com/engine/reference/builder/#copy), the `COPY` command is used to copy files or directories from the host to the container. You say you have problems with the destination path because you only know how to do it in Linux. But it's Linux. Sorry but I don't really know how do you want to involve Windows paths here. – Álvaro González Jan 05 '22 at 15:13

1 Answers1

0
FROM nginx:alpine
COPY default.conf /etc/nginx/conf.d/default.conf
COPY ./MyWebFolder /usr/share/nginx/html

Here is a simple docker file which i used to copy my html files inside my "MyWebFolder" to nginx html folder from where website will be hosted. You dont have to worry about image built in windows docker or linux. Just make sure images are built in linux containers by docker desktop. (https://docs.docker.com/engine/faq/)

Santosh Karanam
  • 1,077
  • 11
  • 23