By default docker runs the container as root user unless specified otherwise. In order to force docker to run the container as the same user as the docker daemon add --user flag as show below to docker run command.
docker run --user "$(id -u):$(id -g)"