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

一、问题症状

docker 启动报错:

PermissionError: [Errno 13] Permission denied: 'config.ini'

二、问题原因

权限不足。

二、解决方案

设置 PUID,PGID:

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

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。

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注