错误 - Docker-compose/docker Windows [英] ERROR - Docker-compose/docker Windows
问题描述
我想在 Windows 系统上部署我的应用程序.我最近(昨天)在 Windows 10 上安装了 DockerToolbox-1.12.4
.这给了我一个新终端.当我尝试使用 docker-compose up --build
部署我的项目时,我收到以下消息:
I wanted to deploy my application on a windows system. I recently (yesterday) installed DockerToolbox-1.12.4
on my windows 10. This gives my a new terminal. When I tried to deploy my projet with docker-compose up --build
, I receive this massage:
错误:对于 myservice 无法为 myService 创建容器:创建var undocker.sock: "\var\run\docker.sock" 包括无效本地卷名的字符,只允许[...][...]"
此服务包含
ERROR: for myservice Cannot create container for myService: create var undocker.socker: "\var\run\docker.sock" includes invalid characters for a local volume name, only "[...][...]" are allowed
this service contains
另一个错误是:
错误:对于 service2 无法为服务 service2 创建容器:无效的绑定安装规范"c:\Users\username\Desktop\project\service2:/home/docker/code:rw"启动项目时遇到错误
.我的项目有 4 个容器,另外 2 个没有错误消息.
ERROR: for service2 Cannont create container for service service2: Invalid bind mount spec "c:\Users\username\Desktop\project\service2:/home/docker/code:rw" Encountered errors while bringing up projet
. My project has 4 containers and there is not error message for the 2 others.
这是我的 docker-compose.yml 文件:
here is my docker-compose.yml file:
version: '2'
services:
s1:
build: ../images/s1
ports:
- "5000:5000"
links: ["s2"]
s2:
build: ../images/s2
ports:
- "9000:9000"
service2:
build: ../images/service2
ports:
- "4000:4000"
volumes:
- ../images/service2:/home/docker/code
myService:
build: ../images/myService
ports:
- "7000:7000"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
我该怎么做才能使它起作用?你能帮忙解决这个问题吗?
What should I do to make this works ? Can you please help to solve this ?
我的docker版本是:docker version 1.12.4, build 1564f02
我的 docker-compose 版本是:docker-compose version 1.9.0, build 2585387
my docker version is : docker version 1.12.4, build 1564f02
my docker-compose version is : docker-compose version 1.9.0, build 2585387
推荐答案
我认为您必须在您的环境中设置 COMPOSE_CONVERT_WINDOWS_PATHS=1
.见:
I think you have to set COMPOSE_CONVERT_WINDOWS_PATHS=1
in your environment. See:
这篇关于错误 - Docker-compose/docker Windows的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!