我在用beardedio 的 Terraria 服务器 docker-compose 文件:
version: '3'
services:
terraria:
image: beardedio/terraria:vanilla-latest
ports:
- '7777:7777'
restart: unless-stopped
environment:
- world=myworld.wld
volumes:
- $HOME/terraria/config:/config
tty: true
stdin_open: true
我将 docker-compose.yml 文件保存在 /home/terraria/config 中,这也是存储 worldfile 的地方。检查日志后,似乎容器由于找不到 world 文件而不断重新启动:
~$ docker logs --tail 50 --follow --timestamps config_terraria_1
2022-06-18T09:37:59.015754844Z World file does not exist! Quitting...
2022-06-18T09:37:59.648848860Z World file does not exist! Quitting...
2022-06-18T09:38:00.312203861Z World file does not exist! Quitting...
2022-06-18T09:38:01.167585791Z World file does not exist! Quitting...
2022-06-18T09:38:02.388691358Z World file does not exist! Quitting...
2022-06-18T09:38:04.437094345Z World file does not exist! Quitting...
2022-06-18T09:38:08.084673575Z World file does not exist! Quitting...
2022-06-18T09:38:14.948840125Z World file does not exist! Quitting...
2022-06-18T09:38:28.196745171Z World file does not exist! Quitting...
2022-06-18T09:38:54.270838042Z World file does not exist! Quitting...
有人知道我应该把文件放在哪里,或者这个问题是否更复杂?
抱歉,如果我没有遵循正确的礼仪或其他什么的,我对这个论坛和 Ubuntu/Linux 都比较陌生
答案1
卷映射的路径似乎有问题。尝试使用没有变量的绝对路径,即:
volumes:
- /home/terraria/config:/config
请报告此问题是否已解决?