use whoami instead of logname for non-login shells, e.g. docker run