Soerendip
Soerendip

Reputation: 9138

How to mount a windows folder in docker container?

On my windows notebook I try to share a folder with my docker container, but I am getting a weird error message that does not tell me anything.

docker run -p 9999:9999 -it msmint/msmint:latest  -v c:/Users/swacker/MINT:/data/

docker: Error response from daemon: OCI runtime create failed: container_linux.go:380: starting container process caused: exec: "-v": executable file not found in $PATH: unknown.

The /data folder in the docker file is present and I gried different formats for the windows path such as C:\User\swacker\MINT.

It complains that an executable file is not found, but I don't know which one.

Upvotes: 2

Views: 12027

Answers (1)

Hans Kilian
Hans Kilian

Reputation: 25070

Options for docker need to go before the image name. Anything after the image name is a command for the container and replaces any defined CMD in the image.

So you need to do

docker run -p 9999:9999 -it -v c:\Users\swacker\MINT:/data/ msmint/msmint:latest  

I've changed the slashes in your Windows path to backslashes.

Upvotes: 5

Related Questions