Ultimate docker permission solution
I'm a little confused about the exact use case. Are you asking about writing to volumes that are mounted inside the container? 

You can change what the process in the docker container runs as by using --user on your run commands.

docker run --user 1000 --ti centos/7 /bin/bash


This answer may help you: 
https://stackoverflow.com/questions/41100333/difference-between-docker-run-user-and-group-add-parameters

The manual explains this as well: https://docs.docker.com/engine/reference/run/#user