Following is my docker-stack file.
version: "3"
services:
my-app:
image: my-image:latest
volumes:
- ./certs:/certs
ports:
- 6401:6401
networks:
my-net:
ipv4_address: 192.168.0.4
networks:
my-net:
external: true
It works fine on my machine, binding certs folder to certs inside the container. However doesn't work in my CI pipeline where i am deploying this service inside a docker-stack-node image. The error i get is
invalid mount config for type "bind": bind mount source path does not exist.
I read that If you bind mount a host path into your service’s containers, the path must exist on every swarm node. So, I think i need to create a named volume. However, with the named volume i can't specify source path of certs. It's confusing. Can someone help with this?