Docker Volume not mounting any files

Docker & Virtualbox seem to have an issue with mounting a volume outside of the /Users directory. The only way to fix the issue is to delete the docker machine image, properly set the /Users/yourname directory as the share folder in Virtualbox and create a new docker machine image.

Steps to fix the issue:

  1. docker-machine stop dev
  2. docker-machine rm dev
  3. docker-machine create --driver virtualbox dev
  4. eval "$(docker-machine env dev)"
  5. docker build -t davesrepo/dynamo -f ./Dockerfile .
  6. docker run -v $(pwd):/var/dynamo -d -t -p 8001:8001 --env-file ./dynamo.env --name dynamo davesrepo/dynamo
  7. docker exec -it dynamo /bin/bash
  8. ls

root@42f9e47fa2de:/var/dynamo# ls Dockerfile README.md __init__.py __pycache__ bin config.ini requirements.txt seed.sql tests

Files!


I found out that I changed my windows password and docker requires windows credentials to mount volumes, you can update it settings > shared drives.