openshift部署基于nginx的项目报错

文章讲述了运行nginx容器时遇到Permissiondenied错误的主要原因是权限不足。解决方案是将nginx配置文件挂载到容器中并运行nginx作为非root用户。具体操作包括修改nginx.conf文件,设置临时文件路径,并使用$dockerrun$命令进行启动。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

(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;
...
}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值