BY default when you run
docker run -it [myimage]
OR
docker attach [mycontainer]
you connect to the terminal as r
You can specify USER in the Dockerfile. All subsequent actions will be performed using that account. You can specify USER one line before the CMD or ENTRYPOINT if you only want to use that user when launching a container (and not when building the image). When you start a container from the resulting image, you will attach as the specified user.