群晖 DSM7.X docker 启动权限不足问题解决方案

2024-09-29 20:03:11 浏览数 (6)

群晖更新DSM 7 之后 docker 无法启动,特记录问题及解决方案。

问题症状

docker 启动报错:

代码语言:javascript复制
PermissionError: [Errno 13] Permission denied: 'config.ini'

问题原因

权限不足。

解决方案

设置 PUID,PGID:

首先是PGID,和PUID。Docker Hub readme中解释了如何查看。

代码语言:javascript复制
User / Group Identifiers

When using volumes (-v flags) permissions issues can arise between the host OS and the container, we avoid this issue by allowing you to specify the user PUID and group PGID.

Ensure any volume directories on the host are owned by the same user you specify and any permissions issues will vanish like magic.

In this instance PUID=1000 and PGID=1000, to find yours use id user as below:

$ id username
uid=1000(dockeruser) gid=1000(dockergroup) groups=1000(dockergroup)

gid一般100是普通用户组,101是管理员组。设置成100有时候会没权限,所以设成101。

1 人点赞