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

solve "permission denied, open logs/****" #4

Closed
wants to merge 1 commit into from

Conversation

luffy1937
Copy link

@luffy1937 luffy1937 commented Apr 13, 2018

#5 主机上的docker一般是root权限来操作的,如果bind的volumes不存在,会已以root权限创建。所以如果以easy-mock用户执行“npm start”命令,会有文件权限问题,如下:

default

主机上的docker一般是root权限来操作的,如果bind的volumes不存在,会已以root权限创建。所以如果以easy-mock用户执行“npm start”命令,会有文件权限问题。
@DuanPengfei
Copy link
Collaborator

在容器中以 root 用户运行程序感觉不是一个很好的选择,一方面由于权限过高,另一方面,root 用户产生的文件在宿主机非 root 用户是无法访问的。

@DuanPengfei DuanPengfei mentioned this pull request Jan 15, 2019
@doxiaodong
Copy link
Contributor

doxiaodong commented Mar 8, 2019

容器内用root没有问题吧,我看大部分都是ROOT 的,而且也比较简单。 不用 root 现在这个没法解决呀.

比如你这里依赖的 mongo 和 redis 都没有这个问题

@howel52
Copy link
Contributor

howel52 commented Jun 19, 2019

今天在Debian上用docker部署时也遇到了,可以试下 chmod 777 /home/*/logs,我这边work了

@DuanPengfei
Copy link
Collaborator

@howel52 的方式可以正常工作,把权限交换给用户自行处理比较好,因为很多用户没有 root 权限,容器里面要是使用了 root 会导致宿主机无法操作文件,README 里面 @howel52 已经添加好了,issue 关闭了,有需要再打开。

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

Successfully merging this pull request may close these issues.

None yet

4 participants