错误-Docker-compose / docker Windows

dmx*_*dmx 4 windows docker docker-compose

我想在Windows系统上部署我的应用程序。我最近(昨天)安装DockerToolbox-1.12.4在Windows 10上。这为我提供了一个新终端。当我尝试使用部署我的项目时docker-compose up --build,我收到以下消息:

  1. ERROR: for myservice Cannot create container for myService: create \var\run\docker.socker: "\\var\\run\\docker.sock" includes invalid characters for a local volume name, only "[...][...]" are allowed 该服务包含

另一个错误是:

  1. 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。我的项目有4个容器,而其他2个没有错误消息。

这是我的docker-compose.yml文件:

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
Run Code Online (Sandbox Code Playgroud)

我应该怎么做才能使它起作用?您能帮忙解决这个问题吗?

我的docker版本是:docker version 1.12.4, build 1564f02 我的docker-compose版本是:docker-compose version 1.9.0, build 2585387

小智 11

这个例子对我有用

  test_dev:
    image: test/node:7.9
    ports:
      - "3000:3000"
    volumes:
      - //c/Users/user/Sources:/usr/src/app/
    command:
     node /usr/src/app/start.js
Run Code Online (Sandbox Code Playgroud)


fri*_*ism 5

我认为你必须COMPOSE_CONVERT_WINDOWS_PATHS=1在你的环境中设置。看: