-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
feat: add docker permission related settings #380
Conversation
感谢感谢,我还堵在高速上呢,明天看看 |
没事,我也是第一次提交pr,明天你看看有没有问题 |
apk upgrade --no-cache && \ | ||
apk add --no-cache bash su-exec; \ | ||
chmod +x ./entrypoint.sh && \ | ||
rm -rf /var/cache/apk/* | ||
VOLUME ["/app/storage"] | ||
EXPOSE 9999 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我对比了下alist的dockerfile,这里少了一行ENV PUID=0 PGID=0 UMASK=022
entrypoint.sh
Outdated
mkdir /Downloads | ||
|
||
chown -R ${PUID}:${PGID} /app /Downloads |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
下载目录是/root/Downloads
,可以不用创建了,直接改成:
chown -R ${PUID}:${PGID} /root/Downloads
entrypoint.sh
Outdated
if [ "$#" -gt 0 ]; then | ||
exec su-exec ${PUID}:${PGID} ./gopeed "$@" | ||
else | ||
exec su-exec ${PUID}:${PGID} ./gopeed | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里的判断可以不要了,直接换成:
exec su-exec ${PUID}:${PGID} ./gopeed "$@"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我参考了下alist的dockerfile给了点修改建议,你看看
我试了有问题,给gopeed设置普通用户权限后他会自己在根目录创建Downloads目录并设置为下载目录,手动改回/root/Downloads也没权限,即使我设置/root/Downloads所有者跟程序一样也不行,其他应该没问题了 |
我考虑了下,为了不同用户统一安装目录,下个版本把docker里的默认下载目录改成 |
根目录/Downloads作为默认下载目录可行吗?反正都要映射出来 |
这不是根本解决办法,等新版修改默认下载地址后再说吧 |
抱歉久等了,Docker构建默认下载目录改成 |
等我一下,时间有点久我有点忘了,先研究研究 |
看看这样应该ok了 |
LGTM |
给docker镜像添加了设置用户用户组umask功能