When starting a Linux container (details below). I am seeing success with docker run ...
but docker-compose up
fails complaining about the bind mount path. It feels like docker run
is bind mounting the volume to the linux VM (via Hyper V)
Docker Compose Error
Cannot create container for service registrator: b'Mount denied:
The source path "\\var\\run\\docker.sock:/tmp/docker.sock"
is not a valid Windows path'
Here are details about how I am starting the container:
Docker Run (works as expected):
docker run --network=host --volume=/var/run/docker.sock:/tmp/docker.sock gliderlabs/registrator consul://localhost:8500
Docker Compose:
registrator:
image: gliderlabs/registrator
command: "consul://consul:8500"
network_mode: host
volumes:
- /var/run/docker.sock:/tmp/docker.sock
OS: Windows 10 1709 (OS Build 16299.371)
Docker for Windows: 18.04.0-ce
Docker Compose: 1.21.0
Copyright Notice:Content Author:「KevM」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/49822178/on-windows-bind-mount-volumes-behave-differently-in-docker-compose-than-docker