Answer the question
In order to leave comments, you need to log in
Why doesn't docker map directories on Windows 7?
Hello dear All!
I ran into a situation - there is a configured and working package for docker-compouse and everything works fine in Linux. But the task was to run all this in Windows 7/8/10. I installed Docker on Windows using docker-toolbox and everything seems to be assembled and running, BUT in the docker-compose file I have settings for partition mapping:
application:
build: ./application
volumes:
- /с/user/company/master:/var/www
workspace:
build:
context: ./workspace
volumes_from:
- application
docker exec -it workspace bash
Answer the question
In order to leave comments, you need to log in
In general, the solution seemed to be simple, the difficulty was to read the documentation to the right place, given that the docker in Windows is over virtualization ....
In general, for the necessary actions with mounting the ball, you must take into account that the docker in Windows 7 works through virtualbox + cropped-slaughtered Linux Tiny, and in this virtual linux, docker actually works. It should be taken into account that by default VirtualBox mounts c:\Users\ and through it the docker will access the necessary directories. After I put the data of interest to me in c: \ Users - I distorted the virtual machine and rebuilt the necessary images - everything appeared and worked.
Because under windows docker runs in vm, then it needs files inside vm. As an option, share files inside vm.
If you work from under docker tols (windows 7), then you need to add a shared folder in VirtualBox in the settings that is different from C:\Users After all, this is exactly what I wanted. At the same time, give it a convenient name and check the auto connection box.
For example, the folder "C:\projects" can be named "c/projects" (with / - this is to understand on which disk).
All this is done with the docker machine stopped. In other words, if the docker console is running, then:
docker-machine stop
And after making the settings:
docker-machine start
Next, you can mount existing folders inside it:
docker run -v /c/projects/<path to the folder to be mounted>:<folder to container> <image name>
Faced such a problem, the nginx config is mapped as a directory, and the directory is empty
nginx:
image: nginx:1.15.0
container_name: 'nginx'
working_dir: /app
ports:
- '80:80'
volumes:
- /c/work/OSPanel/domains/docker/docker/nginx/nginx.conf:/etc/nginx/nginx.conf
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question