(13: Permission denied)
主要原因就是因为权限不足
nginx的docker hub地址
其实在dockerhub上就有对这个问题解释
Running nginx as a non-root user
修改nginx.conf
$ docker run -d -v $PWD/nginx.conf:/etc/nginx/nginx.conf nginx
pid /tmp/nginx.pid;
http {
client_body_temp_path /tmp/client_temp;
proxy_temp_path /tmp/proxy_temp_path;
fastcgi_temp_path /tmp/fastcgi_temp;
uwsgi_temp_path /tmp/uwsgi_temp;
scgi_temp_path /tmp/scgi_temp;
...
}
文章讲述了运行nginx容器时遇到Permissiondenied错误的主要原因是权限不足。解决方案是将nginx配置文件挂载到容器中并运行nginx作为非root用户。具体操作包括修改nginx.conf文件,设置临时文件路径,并使用$dockerrun$命令进行启动。
774

被折叠的 条评论
为什么被折叠?



