PHP& Docker:脚本无法写入/ tmp

时间:2014-09-18 21:44:27

标签: php docker

我用Nginx&创建了一个Docker镜像。 PHP 5用于我的项目,但由于缺少/ tmp的权限,我收到了运行时错误。它必须是一个卷还是有特殊的Dockerfile配置?

fopen(/tmp/myerror.log): failed to open stream: Permission denied

2 个答案:

答案 0 :(得分:4)

我必须添加RUN chmod 777 -R / tmp&& chmod o + t -R / tmp过去我的Dockerfile

答案 1 :(得分:0)

chmod 777 (please no ! )
chown -R yourmachinename:yourmachinename /tmp