Docker Community Forums

Share and learn in the Docker community.

Docker sharing /var/run/docker.sock when deploying through docker-machine


(Maximgeerinck) #1

I’ve been trying to deploy my containers using docker-machine using docker-compose.

My configuration should be as followed:

letsencrypt-nginx-proxy-companion:
  image: jrcs/letsencrypt-nginx-proxy-companion
  volumes_from:
    - nginx
  volumes:
    - /var/run/docker.sock:/tmp/docker.sock:ro
    - nginx_certs:/etc/nginx/certs:rw
  environment:
    - NGINX_DOCKER_GEN_CONTAINER=nginx-gen

and i would like this to happen from a windows host to a linux server. My Linux server is marked as active and thus should redirect all commands i execute.

Everytime i run the docker-compose up -d i get the following error message:

for letsencrypt-nginx-proxy-companion Cannot create container for service letsencrypt-nginx-proxy-companion: create \var\run\docker.sock: "\\var\\run\\docker.sock" includes invalid characters for a local volume name, only "[a-zA-Z0-9][a-zA-Z0-9_.-]" are allowed

Hopefully anybody could help me fixing this error


(Maximgeerinck) #2

Was fixed in docker-compose v1.10 of windows


(Archimedes Trajano) #3

Having the same issue on mine. I am on docker-compose version 1.19.0, build 9e633ef3 I used the following in docker-compose

 services:
   jenkins:
     image: jenkins/jenkins
     ports:
     - target: 8080
       published: 18080
       protocol: tcp
     volumes: 
     - /var/run/docker.sock:/var/run/docker.sock

However when I set COMPOSE_CONVERT_WINDOWS_PATHS=1 it started to work. Except that docker-slaves plugin still does not work correctly, but that’s another matter.