今天把 docker for windows 运行的正常的一套 docker-compose 转移到 centos 中 发现 php-fpm 镜像总是启动失败 查看 docker logs 是没有 /var/log 的权限(配置的慢日志目录) github: https://github.com/WencoChen/docker-LNMP/tree/dev 下面是各文件的权限情况
/var/log/dnmp # ls -alF
total 0
drwxr-xr-x 2 root root 89 Dec 9 14:12 ./
drwxr-xr-x 1 root root 18 Dec 12 14:55 ../
-rw-r--r-- 1 root root 0 Dec 9 14:12 api.error.log
-rw-r--r-- 1 root root 0 Dec 9 14:12 nginx.error.log
-rw-r--r-- 1 root root 0 Dec 9 14:12 nginx.localhost.https.error.log
/var/log/dnmp # ps -ef | grep php-fpm
1 www-data 0:00 php-fpm: master process (/usr/local/etc/php-fpm.conf)
8 www-data 0:00 php-fpm: pool www
9 www-data 0:00 php-fpm: pool www
58 root 0:00 grep php-fpm
/var/log/dnmp # ps -ef | grep php
1 www-data 0:00 php-fpm: master process (/usr/local/etc/php-fpm.conf)
8 www-data 0:00 php-fpm: pool www
9 www-data 0:00 php-fpm: pool www
60 root 0:00 grep php
/var/log/dnmp # ls -alF
total 0
drwxr-xr-x 2 root root 89 Dec 9 14:12 ./
drwxr-xr-x 1 root root 18 Dec 12 14:55 ../
-rw-r--r-- 1 root root 0 Dec 9 14:12 api.error.log
-rw-r--r-- 1 root root 0 Dec 9 14:12 nginx.error.log
-rw-r--r-- 1 root root 0 Dec 9 14:12 nginx.localhost.https.error.log
/var/log/dnmp #
1
Wenco OP docker logs :
ERROR: Unable to create or open slowlog(/var/log/dnmp/php.slow.log): Permission denied (13) |