Useful or not, from you.
for-win Errror mkdir /host_mnt/c: file exists when restarting docker container with mount

Expected behavior

Container should start normally

Actual behavior

C:\Users\einom>docker start f96263b10996 Error response from daemon: error while creating mount source path '/host_mnt/c/Users/einom/Documents/projects/cap/src': mkdir /host_mnt/c: file exists Error: failed to start containers: f96263b10996

Information

Docker version: 17.12.0-ce-win47 (15139)

Windows 10 Pro Version: 1709 Build: 16299.192

Whole C drive is shared with docker VM

Steps to reproduce the behavior

  1. start container with command similar than me in my home dir docker run -d --name sonarqube -p 9000:9000 -p 9092:9092 -v c:/Users/einom/Documents/projects/cap/src:/src:rw sonarqube
  2. use container and enjoy that directory in container /src is mounted OK
  3. docker stop this container
  4. docker start container ... and you got error ... mkdir /host_mnt/c file exist.

Of cource it exists because if I understand correctly this /host_mnt/c should point to my whole C: drive ?

That's a useful answer
Without any help

I had the same issue. I was able to resolve it by running: docker volume rm -f [name of docker volume with error] Then restarting docker, and running: docker-compose up -d --build

I tried these same steps without restarting my docker, but restarting my computer and that didn't resolve the issue. What resolved the issue for me was removing the volume with the error, restarting my docker, then doing a build again.

Unsure if you did, but please can you kindly explain the meaning of the "-d" and "--build" in "docker-compose up -d --build" please?

I don't mean "this is what the man-page says", rather I mean what is the human explanation of the flags?

Also, this worked perfectly for me, I had to restart the host machine aswell.