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.
-
docker container ps --all
does not show my container. -
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?