Каким образом правильно настроить права доступа между хост машиной и контейнером?
$ tree
├── docker-compose.yml
├── Dockerfile
└── www
└── index.html
Dockerfile
FROM php:5.6-apache
ADD www/ /var/www/html/
EXPOSE 80
docker-compose.yml
version: '2'
services:
php5_6:
build: .
ports :
- "80:80"
volumes:
- ./www:/var/www/html/
$ docker-compose up
[core:error] [pid 17] (13)Permission denied: [client 172.19.0.1:53514] AH00035: access to /index.html denied (filesystem path '/var/www/html/index.html') because search permissions are missing on a component of the path
чручусь
$ docker exec -it test /bin/bash
# ls -la
ls: cannot open directory .: Permission denied
# id
uid=0(root) gid=0(root) groups=0(root)
# cd ..
# ls -la
total 4
drwxr-xr-x. 3 root root 18 Feb 28 17:31 .
drwxr-xr-x. 12 root root 150 Feb 28 17:59 ..
drwxrwxr-x. 2 www-data 1000 4096 Mar 4 12:22 html
Аналогичные вопросы:
https://denibertovic.com/posts/handling-permissions-with-docker-volumes/
https://forums.docker.com/t/hot-to-mount-local-directories-as-a-non-root-user...