12

How to mount windows folder using docker compose volumes?

I am trying to set up docker container using docker-compose. My docker-compose.yml file looks as follow:

php-fpm: build: php-fpm container_name: php-fpm volumes: - ../project:/var/www/dev 

When i enter to the container like this:

docker exec -it php-fpm bash 

And display content with ls command the /var/www/dev directory is empty. Does enyone know the solution for this ?

$ docker -v Docker version 1.12.0, build 8eab29e $ docker-compose -v docker-compose version 1.8.0, build d988a55 

I have Windows 10 and docker is installed via Docker ToolBox 1.12.0

@edit The mounted directory is also empty under Linux enviroment

2
  • May help: github.com/docker/docker/issues/22981 Commented Sep 13, 2016 at 10:26
  • 2
    Are you using Docker for Windows or Docker Toolbox? (show your docker info). Also, is your docker-compose file under your Users directory? Under Docker Toolbox (virtualbox), only the Users dir is mapped to the host. Commented Sep 13, 2016 at 11:39

1 Answer 1

10

I fixed it by going to: Local Security Policy > Network List Manager Policies and Double-clicked unidentified Networks then change the location type to private and restarted Docker. Source

Sign up to request clarification or add additional context in comments.

1 Comment

This solution may have security risks

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.