Docker Community Forums

Share and learn in the Docker community.

Cannot start opencv docker container

Hello, to start a opencv docker container i’m using this command
docker run -it --rm --mount type=bind,source="$(pwd)"/work,target=/work -p 8888:8888 opencvcourses/course-1

But i get following error-
“docker: Error response from daemon: invalid mount config for type “bind”: invalid mount path: ‘$(pwd)/work’ mount path must be absolute.”

I have already mounted the images from docker.
Though this command works " docker run -it opencvcourses/course-1" to open docker container, but i’m unable to open the Jupyter notebook in it. Can someone help please?

Please, always use the </> button for codes. The quotation marks were changed by the markdown interpreter in your first command. I fixed it for you.

Based on your errror message I would say that you originally used apostrophes (single quotes) instead of the double quotes so the Linux host could not interpret your subshell. The other possibility is that you use a different operating system, not linux. Since Powershell on Windows also support this syntax, it could be cmd.exe which would give you the same message

Thanks, I sorted it out by, it was the --mount command, specifically the “$(pwd)”/work address, i changed to %cd%/work, thenit worked. Thank you.

Then I was right. %cd% is a cmd.exe syntax and $(pwd) is what you can use on Linux or in PowerShell on Windows

Thank you, now its working and i can even deploy my jupyter notebook from it :slight_smile: