kezhenxu94/house-renting

无法安装和创建服务: invalid volume specification

smelike opened this issue · 3 comments

Bug 描述 (Describe the bug)

docker-compose up --build -d 遇到报错

Creating elasticsearch ... error
Creating redis         ...

ERROR: for elasticsearch  Cannot create container for service elastic: invalid volume specification: 'F:\python\house-renting\data\elastic:/Creating redis         ... error

ERROR: for redis  Cannot create container for service redis: invalid volume specification: 'F:\python\house-renting\data\redis:/data:rw'

ERROR: for elastic  Cannot create container for service elastic: invalid volume specification: 'F:\python\house-renting\data\elastic:/usr/share/elasticsearch/data:rw'

ERROR: for redis  Cannot create container for service redis: invalid volume specification: 'F:\python\house-renting\data\redis:/data:rw'
ERROR: Encountered errors while bringing up the project.

截图 (Screenshots)

桌面环境 Desktop (please complete the following information):

  • 操作系统(OS): windows 10 家庭版

Windows非专业版,是在使用docker toolbox吗,如果是的话是因为启动目录位于C盘之外,参考这里 http://support.divio.com/local-development/docker/how-to-use-a-directory-outside-cusers-with-docker-toolbox-on-windowsdocker-for-windows

Windows非专业版,是在使用docker toolbox吗,如果是的话是因为启动目录位于C盘之外,参考这里 http://support.divio.com/local-development/docker/how-to-use-a-directory-outside-cusers-with-docker-toolbox-on-windowsdocker-for-windows

已经设置了,依然出现上面的问题。

@smelike 抱歉回复晚了。请在 docker-compose.yml 同级目录下新建文件 .env,放入以下内容试试:

 COMPOSE_CONVERT_WINDOWS_PATHS=1

参考:
https://stackoverflow.com/questions/41318252/running-a-docker-compose-getting-started-example-causes-invalid-volume-specif