Docker Directory Mount on Windows 10 with Docker Toolbox


To place a local folder in a Docker Container on Windows 10 to mount, you can either use Docker for Windows or if you are using the Windows 10 Home Edition used, one is forced, This by hand with Virtual Box Do.

To do this, you have to use the Docker default Select Box in Virtual Box:

virtual_box_shared_folder

and add a new Shared Folder:virtual_box_shared_folder_add

Then you have to restart the docker-machine in the Docker Toolbox, this will restart the docker default Virtual Box:

docker-machine restart

Now you can mount your directory in his docker-compose.yml:

volumes:
  - /htdocs/my_project:/var/www/html/

Now the folder in the Docker container is successfully mounted.

The following command can be used to test, whether the mount was successful:

docker exec -it CONTAINER_ID ls -ll /var/www/html

Comments are closed.