-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
请改善对非root用户运行docker的支持 #2339
Comments
之前苦寻几天都没有进展,昨天提了issue之后却自行找到了方案: |
@JoeyLearnsToCode debian 版本会有问题吗 |
还没试,明天尝试下 |
debian版本相对alpine版本兼容非 root 用户更简单一些,没有crontab的奇怪问题,只需要在 Dockerfile 里以 root 用户给非root用户赋予一些目录的权限即可。 我是基于debian 分支的 Dockerfile来进行修改的,发现两个问题:
|
Clear and concise description of the problem
我的环境不能用root用户运行docker,青龙无法直接使用。我有一点编程基础,改了改Dockerfile重新编译,总算能够启动了。
但是启动后添加新定时任务时会报错,刷新一下会发现任务能够被查询出来,但是不会被定时执行。
我查了一下,可能是因为alpine系统上crond、crontab命令要求root权限?
Suggested solution
把对系统crond、crontab的依赖替换为 https://github.com/gjcarneiro/yacron 这种应用级的实现应该能从本质上解决这个问题。
但是这可能不现实,开发量太大。
如果官方能提供“以非root用户运行”的指引文档,相信会对很多人有所帮助。
或者,能否指导下,一次新增定时任务从前端发起请求,到后端经历了哪些步骤? 我猜在我的情况下,报错的是最后一步——把定时任务添加到crontabs中时。但是我看代码绕晕了,不知道这一步是在哪里😭
Alternative
No response
Additional context
https://stackoverflow.com/questions/36453787/failed-to-edit-crontab-linux-alpine
https://gitlab.alpinelinux.org/alpine/aports/-/issues/5380
Validations
The text was updated successfully, but these errors were encountered: