大家好,我在通过 docker compose 拉起容器时遇到文件夹无法映射的问题,具体描述如下
在容器中,项目大概结构如下
|---app
|---data
|---web
|---template
|---assets
在文件夹 template
和 assets
下面还有一些文件夹和文件,而文件夹 data
下面只有两个文件,我想将它们映射到主机本地来,docker-compose.yaml
文件
volumes:
- ~/proj/web:/app/web
这时拉起容器,总会出错,总是提示文件不存在
timestamp="20/12/2022 04:45:36.642" func=typeutils.populateDefaultAvatars level=WARN msg="populateDefaultAvatars: error reading default avatars at /app/web/assets/default_avatars: open /app/web/assets/default_avatars: no such file or directory"
timestamp="2022/12/20 04:45:40 error executing command: error creating router: /app/web/template doesn't seem to contain the templates; index.tmpl is missing: stat /app/web/template/index.tmpl: no such file or directory"
请问这个问题怎么解决?谢谢
提示你说:
/app/web/template/index.tmpl: no such file or directory
,即找不到该文件。~/proj/web
下有template/index.tmpl
~
,将~/proj/web
改为绝对路径,比如:/User/yourname/proj/web