The package shadow adds the useradd / usermod / etc. commands. We then add a new user and specify the UID, GID and HOME directory. Note that in line 8 we first create the home directory of our user so that we can add custom exports to a .profile file located under $HOME at the end of the Dockerfile.
Because the docker build command will be somewhat longer due to all the build arguments needed in the Dockerfile, we will use the following helper-script docker_build.sh: