我在Centos7上安装了Docker,并启用了selinux,Docker守护进程使用--selinux-enabled标志启动。
当我尝试运行以下命令时
docker run -it -v /usr/local/xya/log:/usr/local/xya/log:z centos/systemd touch /usr/local/xya/log/test
我得到了以下错误:
docker: Error response from daemon: error setting label on mount source '/usr/local/xya/log': relabeling content in /usr is not allowed.
根据一些文章(http://jaormx.github.io/2018/selinux-and-docker-notes/),'z'标志应该使/usr可写;不确定是否有遗漏。 Docker版本为19.03.3,构建版本为a872fc2f86,CentOS版本为CentOS Linux release 7.5.1804。