Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
2.3k views
in Technique[技术] by (71.8m points)

docker-compose使用volumes挂载目录的权限问题?

nginx镜像,使用docker-composevolumes挂载的web目录。

主机CentOS 7.6,已经关了SELinuxweb目录也设置了777权限。

但是访问时,nginx容器内一直报错 open() "/application/demo/index.html" failed (13: Permission denied),

有没遇到过此问题的朋友 ?求解决方法。

同版本的centos、docker、docker-compose在虚拟机中试过都正常。但是在线上环境就会这样的错误。


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

你需要确认一下docker容器和服务器使用的用户是否相同。


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...