Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x86_64_Ubuntu Server 22.04 系统下小雅容器内读取不到/etc/xiaoya目录的问题 #85

Closed
wukongdaily opened this issue May 2, 2024 · 2 comments

Comments

@wukongdaily
Copy link

wukongdaily commented May 2, 2024

如题,发现了一个非常奇怪的问题。此问题在ARM64平台的Ubuntu Server系统未发现。但是在x86_64的Ubuntu Server出现。

'tvbox.zip' saved
cat: can't open '/data/mytoken.txt': No such file or directory
Thu May 2 17:17:43 CST 2024 current index file version is updated, no need to upgrade
httpd: bind: Address in use
请检查已正确配置 mytoken.txt myopentoken.txt temp_transfer_folder_id.txt 后再重启容器

在宿主机检查/etc/xiaoya目录 已经包含了mytoken.txt myopentoken.txt temp_transfer_folder_id.txt 这三个文件并且不为空。
日志提示 cat: can't open '/data/mytoken.txt': No such file or directory
由于容器一直在重启中,所以不好定位,但是迅速打印容器内/data目录确实没有映射成功。容器内/data 是空的。
所以我干脆自己新建一个别的目录 /mnt/xiaoya
将mytoken.txt myopentoken.txt temp_transfer_folder_id.txt 这三个文件拷贝到 /mnt/xiaoya 目录下
然后执行

docker run -d -p 5678:80 -p 2345:2345 -p 2346:2346 -v /mnt/xiaoya:/data -v /mnt/xiaoya/data:/www/data --restart=always --name=xiaoya xiaoyaliu/alist:latest

这次就成功了,日志显示正常更新数据库,也不报错了。

另外如果增加 --privileged 参数也能正确读取/etc/xiaoya,貌似是敏感目录的权限问题?

docker run -d --privileged -p 5678:80 -p 2345:2345 -p 2346:2346 -v /etc/xiaoya:/data -v /etc/xiaoya/data:/www/data --restart=always --name=xiaoya xiaoyaliu/alist:latest

这就是我遇到的问题,如果xiaoya有空可以帮忙看看吗,谢谢!🙏

@cheng10
Copy link

cheng10 commented Jun 15, 2024

非常有用。我也遇到了一样的问题。不过我是通过把docker bind改成了docker volume解决的。
你换了目录解决了的话,真的很有可能是/etc目录权限的问题。

@Sicheng-zju
Copy link

确实是权限的问题

@DDSDerek DDSDerek pinned this issue Jul 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants