【发布时间】:2021-11-27 00:23:02
【问题描述】:
我已经使用 docker-compose 部署了 monstache,如下所示:
blascal_tasks_monstache:
image: rwynn/monstache:6.7.6
container_name: dev_monstache
working_dir: /monstache
command: -f ./config.toml
volumes:
- ./monstache/dev:/monstache/
ports:
- "5556:8080"
restart: always
它工作正常,但尝试在 kubernetes 中部署它时出现错误:
ERROR 2021/10/06 20:07:56 open ./config.toml: no such file or directory
这是我的规格:
spec:
containers:
- args:
- -f
- ./config.toml
image: rwynn/monstache:6.7.6
name: dev-monstache
ports:
- containerPort: 8080
resources: {}
volumeMounts:
- mountPath: /monstache/dev
name: monstache-claim
workingDir: /monstache
如何指定文件?
【问题讨论】:
-
面向开发人员的 Docker 方法运行未修改的基础映像,然后将代码绑定安装到其中,在 Kubernetes 中效果不佳;集群通常无法访问您的本地文件系统,并且复制两条 Compose
volumes:行可以使 Kubernetes YAML 的总大小增加一倍或三倍。您可以将应用程序代码构建到映像中而不是尝试将其挂载到容器中吗? -
@david-maze 请在这里咨询stackoverflow.com/questions/69475221/…
标签: mongodb docker kubernetes docker-compose yaml