Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ERROR - Docker-compose/docker Windows

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:

  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 this service contains

and an other error is:

  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. My project has 4 containers and there is not error message for the 2 others.

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 ?

my docker version is : docker version 1.12.4, build 1564f02 my docker-compose version is : docker-compose version 1.9.0, build 2585387

like image 424
dmx Avatar asked Dec 18 '16 19:12

dmx


2 Answers

This example works for me:

  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
like image 167
mudrii Avatar answered Nov 15 '22 09:11

mudrii


I think you have to set COMPOSE_CONVERT_WINDOWS_PATHS=1 in your environment. See:

  • https://github.com/docker/compose/issues/4240
  • https://github.com/docker/compose/issues/4253
like image 7
friism Avatar answered Nov 15 '22 11:11

friism