Skip to content

Instantly share code, notes, and snippets.

@kumaraish
Created Nov 25, 2021
Embed
What would you like to do?
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