Forum Discussion
AlonsoCarles
Mar 21, 2024Copper Contributor
Problem with bind volumes in Docker CLI
Hi, When I create a Docker container with a bind volume using PowerShell 7.4.1, for example, this action: docker run --rm -d -p 80:80 --mount type=bind,target=/usr/share/nginx/html,source=$...
LainRobertson
Mar 22, 2024Silver Contributor
I also have to wonder - though I'm not familiar with the docker command or its errors - if it's not simply saying that you cannot have the trailing " nginx" preceded by a space, and perhaps need surrounding quotes? (Assuming it's intended to be part of the source path.)
What happens if you run this instead?
docker run --rm -d -p 80:80 --mount type=bind,target=/usr/share/nginx/html,source="$((pwd).Path)\docs nginx"
Cheers,
Lain