Docker files and folder permissions

i have created a docker lamp(PHP,Mysql,apache), and magento 2 is installed. when i remove generated/var folder or any other folder, the newly created folder does not inherit user/group and write permission from its parent folder.
my host user is dev, while docker runs as root and the newly created folder in docker has user www-data while group is dev and dev don’t have write permission on that folder.

can someone help me regarding this issue.