Skip to content

Instantly share code, notes, and snippets.

@jyotendra
Last active March 5, 2019 18:09
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 jyotendra/8a97d7878d4a12c157e99dea04d6dd32 to your computer and use it in GitHub Desktop.
Save jyotendra/8a97d7878d4a12c157e99dea04d6dd32 to your computer and use it in GitHub Desktop.
Important docker commands

Command to initialize docker container as non-root user

This command also demonstrates "bind volume mount", transferring webcam device to container, port transfer and x11 linux graphic server.

nvidia-docker run -it --device=/dev/video0:/dev/video0 --user=$(id -u $USER):$(id -g $USER) -p=5000:5000 -v /etc/passwd:/etc/passwd -v /etc/group:/etc/group -v /etc/shadow:/etc/shadow -v /tmp/.X11-unix:/tmp/.X11-unix -v /home/jyotendra/project/DeepStream/sample-scripts:/root/ -e DISPLAY=$DISPLAY -w /root 94a 

The following volumes are mounted so as to help with initiating container as non-root user:

  • /etc/passwd
  • /etc/group
  • /etc/shadow

Rest parameters are pretty well documented on docker run docs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment