Docker Community Forums

Share and learn in the Docker community.

Map directory with project code to windows directory

(Maxrdev) #1

Here is docker container with Magento 2

there is a directive

        image: tianon/true
              - ./magento:/var/www/magento

i need to map the code inside docker to windows directory

i tried such paths


all of them doesn’t work, no code in directory

also added this path to the shared directory

How can i do that?


(Sam) #2

volume works the other way… it puts the windows directory into the container, maybe overlaying what was there

(Maxrdev) #3

you mean need to mount this directory inside container?

(Sam) #4

correct, -v or --volume mounts the left hand folder into the container at the right hand location.

(Maxrdev) #5

hmm, seems like it works

checking with php:5.6.15-apache

my command

docker run -d --name simple2 -it -v /p/Users/Admin/pr:/var/www/html -p 80:80 -p 8080:8080 -d php:5.6.15-apache