-1

Hey I am new to Docker and following the docker documentation to learn it. However, I have come across this error while trying to use bind mount as specified https://docs.docker.com/get-started/06_bind_mounts/ and I am using Windows 10 Professional. The code I have run is found below as I have changed the pwd to that of mine.

docker run -dp 3000:3000 `
     -w /app -v "$(pwd):/app" `
     node:18-alpine `
     sh -c "yarn install && yarn run dev"
Robera Negussie
  • 83
  • 1
  • 2
  • 11
  • I've looked those answers before asking the question and did not work for me – Robera Negussie Dec 16 '22 at 13:23
  • yes, they aren't different to your question here in the exact same sense: they do not work for you. However, also as you did this earlier: What have you learned about the error and what makes your case distinctively different compared to those? What is the part that is the same? What part of the error message don't you understand? – hakre Dec 16 '22 at 13:42
  • 2
    This just seems like you're trying to run Node, but on code that lives on the host, without using any of Docker's immutable-image, filesystem isolation, or networking features? You might find it much easier to just [install Node](https://nodejs.org/en/download/) without involving Docker at all. – David Maze Dec 16 '22 at 14:10
  • @RoberaNegussie: This one is specifically for Windows, it gives similar answers, but hopefully it is more accessible for you: https://stackoverflow.com/q/35315996/367456 – hakre Dec 16 '22 at 15:16

1 Answers1

0

I have been able to solve the issue as follows:

docker run -dp 3000:3000 -w /app -v C:\...\getting-started\app:/app node:18-alpine sh -c "yarn install && yarn run dev"

I didn't include the $ and not put my pwd in parentheses.

Robera Negussie
  • 83
  • 1
  • 2
  • 11