I am working on Win - 10 host and linux container. I have successfully followed tutorial docker/getting-started on localhost but when I came to subject - persisting data using Bind Mounts I got stuck.
There’s a command which is mentioned in the tutorial as -
docker run -dp 3000:3000
-w /app -v ${PWD}:/app
node:12-alpine
sh -c “yarn install && yarn run dev”
When I try to run this command I am getting error as invalid reference format in cmd prompt. When I run in Win Powershell I get the error as below -
-w : The term ‘-w’ is not recognized as the name of a cmdlet, function, script file, or operable program. Check the
spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:2 char:5
-
-w /app -v $(PWD):/app \
-
~~
- CategoryInfo : ObjectNotFound: (-w:String) , CommandNotFoundException
- FullyQualifiedErrorId : CommandNotFoundException
node:12-alpine : The term ‘node:12-alpine’ is not recognized as the name of a cmdlet, function, script file, or
operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try
again.
At line:3 char:5
-
node:12-alpine \
-
~~~~~~~~~~~~~~
- CategoryInfo : ObjectNotFound: (node:12-alpine:String) , CommandNotFoundException
- FullyQualifiedErrorId : CommandNotFoundException
sh : The term ‘sh’ is not recognized as the name of a cmdlet, function, script file, or operable program. Check the
spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:4 char:5
-
sh -c "yarn install && yarn run dev"
-
~~
- CategoryInfo : ObjectNotFound: (sh:String) , CommandNotFoundException
- FullyQualifiedErrorId : CommandNotFoundException
Can anyone please help me over here? I am near to finish the tutorial and I am getting this errors.
Not only this, I tried to skip and proceed further to Multi-Container where there is a command -
docker run -d
–network todo-app --network-alias mysql
-v todo-mysql-data:/var/lib/mysql
-e MYSQL_ROOT_PASSWORD=secret
-e MYSQL_DATABASE=todos
mysql:5.7
which also throws the error as invalid reference format.
Thanks.