This document implement of theanam/react-native-docker.
You can mount to the volume without changing the directory permissions.
An example:
docker run --rm -it -v `pwd`:/app -e LOCAL_USER_ID=`id -u` --network host rn-android bash -c "cd android && ./gradlew assembleRelease -x lintVitalRelease"
`rn-android` is image name.