docker volume or create directory, get access deny
……….
Other way
1、make shell and run shell, before run docker-compose.
mkdir ./data
sudo chown docker ./data
#sudo chown user01 ./data
sudo chmod g+rwx ./data
sudo chgrp 994 ./data
Directory exist and correct Access. 994 or 50 or 1000 see /etc/passwd or /etc/group
2、But sometime OS install docker by you don’t know way…
maybe have user dockerroot、group dockerroot or only group docker
you maybe already run sudo usermod -a -G docker $(whoami) 100% in docker group.
A. This time chmod 777 ./data , let docker-compose run
B. ls -al ./data see who make directory or file
C. get this user “user01”, chown user01 ./data
D. run docker-compose now have correct aceess Permission
E. chmod 774 ./data