Created
June 30, 2020 22:29
-
-
Save sandeepkumar-skb/43642f3682e7404bb8adb862c2c7ef72 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker run -it --ipc=host --gpus all --user $(id -u):$(id -g) -v /etc/passwd:/etc/passwd:ro -v /etc/group:/etc/group:ro -v `pwd`:/host <docker_image> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
--user $(id -u):$(id -g)
-> maps user's user_id and group_id-
v /etc/passwd:/etc/passwd:ro -v /etc/group:/etc/group:ro
-> This is a hack since docker containers/etc/passwd
and/etc/group
doesn't container the user's user_id and group_id so if you don't provide this then docker container won't be able to identify the username