I am leaning Docker by using the Getting Started tutorial but am having a problem with the “Starting a Dev-Mode Container” example. When I run:
docker run -dp 3000:3000 -w /app -v "$(pwd):/app" node:12-alpine sh -c "yarn install && yarn run dev"
I get the error:
docker: Error response from daemon: create $(pwd): "$(pwd)" includes invalid characters for a local volume name, only "[a-zA-Z0-9][a-zA-Z0-9_.-]" are allowed. If you intended to pass a host directory, use absolute path.
Additionally, I created a volume with the following inspect data:
[
{
“CreatedAt”: “2020-08-15T20:01:33Z”,
“Driver”: “local”,
“Labels”: {},
“Mountpoint”: “/var/lib/docker/volumes/todo-db/_data”,
“Name”: “todo-db”,
“Options”: {},
“Scope”: “local”
}
]
but the Mountpoint directory does not exist.
wsl ls -l /var/lib
total 20
drwxr-xr-x 2 root root 4096 Apr 16 2019 apk
drwxr-xr-x 2 root root 4096 Apr 16 2019 arpd
drwxr-xr-x 2 root root 4096 Apr 16 2019 iptables
drwxr-xr-x 2 root root 4096 Apr 16 2019 misc
drwxr-xr-x 2 root root 4096 Apr 16 2019 udhcpd
Any help resolving these problems will be greatly appreciated. I am running Windows 10 Pro, 1904.450 with WSL2, 120.2212.31.0 and Docker engine v19.03.12.