Skip to content

Instantly share code, notes, and snippets.

@tmbdev
Created August 27, 2019 22:06
Show Gist options
  • Select an option

  • Save tmbdev/9b8a99d224087fc18a1698d0da601884 to your computer and use it in GitHub Desktop.

Select an option

Save tmbdev/9b8a99d224087fc18a1698d0da601884 to your computer and use it in GitHub Desktop.
run docker image as yourself
#!/bin/bash
image="$1"
shift
docker run \
--runtime=${runtime:-nvidia} \
--network host \
-v /etc/passwd:/etc/passwd \
-v /etc/group:/etc/group \
-v $HOME:$HOME \
-v `pwd`:`pwd` \
${opts:-${DR_OPTS}} \
-w `pwd` \
-u $(id -u):$(id -g) \
-i \
-t "$image" \
"$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment