How to set copy all environment variables from root user to another specific user
<p>In my docker container I am running a command as a specific user like this from <code>entrypoint.sh</code>:</p>

<p><code>sudo -u appuser "$@"</code></p>

<p>This works fine, however, it doesn't set any of the environment variables that get created by using the <code>--link</code> option while running the container. </p>

<p><strong>Question</strong></p>

<p>Is it possible to set all environment variables that exist for a root user to some other specific user (in this example <code>appuser</code>)</p>

<p>Note: related question to this discussion. This is the reason I can't just use the <code>USER</code> command <a href="https://stackoverflow.com/questions/39397548/how-to-give-non-root-user-in-docker-container-access-to-a-volume-mounted-on-the">How to give non-root user in Docker container access to a volume mounted on the host</a></p>