The Permission Problem of Docker Multi-Container Collaboration Sharing volume

  docker, question

Let’s go to the previous structural diagram.
Then the current situation is visitingLocal 8080 portTo visitPort 80 of tengine container
Can be accessed normally
Phpfpm containerShow log: -  12/Nov/2015:08:57:00 +0000 "GET /index.php" 404 -  12/Nov/2015:08:57:00 +0000 "GET /index.php" 404 -  12/Nov/2015:08:57:00 +0000 "GET /index.php" 404

Display 404. Unable to access the page, then I think it may be a permission issue.
[EnterTengine container
[EnterPhpfpm container


I used it directlyphp:5.5.30-fpmThe image of thePhpfpm containerRun up
Phpfpm containerThe/usr/local/etc/php-fpm.confI read the documents

user = www-data
 group = www-data

Here comes the key question:
I am herePhpfpm containerusefulchown -R www-data:www-data /data/sitesAfter the order,
/data/sitesThe owner of all the files below is still staff.
1. Why can’t I change the owner of the volume lock hanging in the directory? When I need to build images, I need to change the permissions and then mount it?
2、staffWhat the hell is this?

Volume’s permissions depend on how the host is given, if you want tophpfpmFolderwww-data:www-dataPermission to execute in your host mount directorychown -R www-data:www-data /data/sitesJust.