简体   繁体   English

如何使用docker撰写卷来装载Windows文件夹?

[英]How to mount windows folder using docker compose volumes?

How to mount windows folder using docker compose volumes? 如何使用docker撰写卷来装载Windows文件夹?

I am trying to set up docker container using docker-compose . 我正在尝试使用docker-compose设置docker容器。 My docker-compose.yml file looks as follow: docker-compose.yml文件如下所示:

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. 使用ls命令显示内容/var/www/dev目录为空。 Does enyone know the solution for this ? enyone知道解决方案吗?

$ 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 我有Windows 10和Docker是通过Docker ToolBox 1.12.0安装的

@edit The mounted directory is also empty under Linux enviroment @edit在Linux环境下,挂载的目录也是空的

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. 我通过以下方式修复了它:本地安全策略>网络列表管理器策略和双击未识别的网络然后将位置类型更改为私有并重新启动Docker。 Source 资源

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM