Skip to content

Instantly share code, notes, and snippets.

@NTU-P04922004
Last active July 16, 2021 06:43
Show Gist options
  • Select an option

  • Save NTU-P04922004/d53287aaffba6d79b941bf8f11186ae0 to your computer and use it in GitHub Desktop.

Select an option

Save NTU-P04922004/d53287aaffba6d79b941bf8f11186ae0 to your computer and use it in GitHub Desktop.
Docker cheatsheet
# References:
# https://github.com/NVIDIA/nvidia-docker#usage
# http://peterforgacs.github.io/2017/04/18/Docker-basics/
#
docker run --gpus '"device=1"' -it --rm -v /home/kuohsin/workspace/tensorrt_lab/torch2trt:/workspace tensorrt
docker container ls -a
docker container rm container_id
sudo docker commit container_id image_name
# Resume container
docker start -a -i container_id
# Delete all stopped containers
docker rm $( docker ps -q -f status=exited)
# Delete all dangling (unused) images
docker rmi $( docker images -q -f dangling=true)
# ---------------------------------------
CAMERA_DEVICE=tt_0927_demo_video.mp4
xhost +local:docker
# Run with the video file
#
docker run -it --rm \
--gpus '"device=1"' \
-e DISPLAY=$DISPLAY \
-v /home/ddtw/workspace/mystique:/workspace \
-v /tmp/.X11-unix:/tmp/.X11-unix \
realtime-deepfake \
python test.py --stream_source=$CAMERA_DEVICE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment