Docker Volume Stops Container from Starting

I am trying to use the following docker-stack.yml file to deploy my services to my Docker Swarm version 17.06-ce. I want to use volumes to map the C:/logs directory on my Windows host machine to the /var/log directory inside my container.

version: '3.3'

services:
  myapi:
    image: mydomain/myimage
    ports:
      - "5000:80"
    volumes:
      - "c:/logs:/var/log/bridge"

When I remove the volumes section, my containers start fine. After adding the volume, the container never even attempts to start i.e.

  1. docker container ps --all does not show my container.
  2. docker events does not show the container trying to start.

The following command works for me, so I know that my syntax is correct:

docker run -it -v "c:/logs:/var/log/bridge" alpine

I’ve read the volumes documentation a few times now. Is the syntax for my volume correct? Is this a supported scenario? Is this a Docker bug?

First thing that comes to mind:

The separator character between “external location” and “internal location” is the “:”.

Since “C:” has that colon I suspect you’re telling docker:

Mount directory “C” outside my container to directory “/logs” inside my container and use the following options to that mount “/var/log/bridge”

Directory “C” doesn’t exist in your local OS, your container probably doesn’t have a “/logs” directory, and the option “/var/log/bridge” isn’t a valid option to the mount command being run in the docker container which is why it’s likely failing.

I fully suspect you need to manage the “:” in this case in some way. Since 99.9% of all documentation out there is Unix based documentation, and Unix doesn’t use a “:” in a directory structure, you are probably going to find it hard to find good docks on how to handle this…but that’s going to be your issue.