You would not want to run this as part of the image building process (in your Docker file), because the host on which someone runs the container is often not the host on which you create the image.
One way to solve this is to pass UID / GID information through environment variables:
docker run -e APP_UID=100 -e APP_GID=100 ...
And then before the CMD :
enter an
ENTRYPOINT script that includes something like the following:
useradd -c 'container user' -u $APP_UID -g $APP_GID appuser chown -R $APP_UID:$APP_GID /app/data
source share