这是我的码头工人撰写文件
version: '2'
services:
demoui:
image: demoimage
ports:
- "80:8000"
volumes:
- ./democonfig/config.js:/usr/local/tomcat/webapps/demo-ui/config.js
- ./logs/demo-ui:/usr/local/tomcat/logs
restart: unless-stopped
当我在单节点中时,这个 docker compose 文件有效。移至 docker swarm 后。它不工作。它抛出以下错误
ERROR: for demoui Error response from daemon: rpc error: code = 2 desc = "oci runtime error: could not synchronise with container process: not a directory"
Traceback (most recent call last):
File "<string>", line 3, in <module>
File "compose/cli/main.py", line 63, in main
AttributeError: 'ProjectError' object has no attribute 'msg'
docker-compose returned -1
所以问题是
如何将文件共享到 swarm 集群?
还是需要将所有文件复制到图像中并运行它?
请与 swarm 分享一些 docker volume 的文档。