Skip to content

Instantly share code, notes, and snippets.

@kumaraish
Created November 25, 2021 12:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kumaraish/3d2e657526a770697764b85d320d6020 to your computer and use it in GitHub Desktop.
Save kumaraish/3d2e657526a770697764b85d320d6020 to your computer and use it in GitHub Desktop.
docker run
--user 0:0
--env MY_USR=$(id -u)
--env MY_GID=$(id -g)
<my_image>
bash -c 'zypper install -l -y xyz;
echo "dummy:x:$MY_USR:$MY_GID:eusers:$PWD:/bin/bash" >> /etc/passwd;
su - dummy -c "<command-to-be-run-with-host-users-permissions>"'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment