Mapping host uid to container uid

Hi All !
I need map my local user UID in to my container user UID, if in container i created file in directory which mapped from host to container, this file have permission root:root - because in container i am root, but i need that owner was “username” from host, who started this container. I not found parameter for mapping localUID:containerUID, Is that possible?
As example,
docker exec -i workspace bash -c "cd var/www && composer installbuild"
after this command ended - i have many files with owner root, but i need localuser:localuser

1 Like