Differences

This shows you the differences between two versions of the page.

Link to this comparison view

public:docker_quick_how-to [2018/03/31 00:38] (current)
Line 1: Line 1:
 +====== Docker Quick How-to ======
 +Well, I use Debian. A lot of things use Ubuntu. For the sake of laziness, I decided to use Docker to run an Ubuntu image. Originally, I installed docker to run Pokemon Go bots.
  
 +===== Basic commands =====
 +  * List running docker processes
 +  ''​docker ps''​
 +  * List all docker containers
 +  ''​docker ps -a''​
 +  * Instantiate an Ubuntu docker instance
 +  ''​docker run -it ubuntu:​16.04 /​bin/​bash''​
 +  * Run docker with GUI support
 +  ''​docker run -it -e DISPLAY=$DISPLAY -v /​tmp/​.X11-unix:/​tmp/​.X11-unix /​bin/​bash''​
 +  * Restart a docker instance
 +  ''​docker start -a -i 9bb21badced9''​
 +  * Clear all stopped docker instances
 +  ''​docker rm `docker ps --no-trunc -aq`''​
 +
 +===== Run Docker with GUI support =====
 +Please note that **you cannot run xterm as root**.
 +<code bash>
 +docker run -it --env="​DISPLAY"​ --env="​QT_X11_NO_MITSHM=1"​ --volume="/​tmp/​.X11-unix:/​tmp/​.X11-unix:​rw"​ ubuntu:​16.04 /bin/bash
 +</​code>​
 +
 +===== Running Docker with GPU support =====
 +<code bash>
 +docker run -it --env="​DISPLAY"​ --env="​QT_X11_NO_MITSHM=1"​ --volume="/​tmp/​.X11-unix:/​tmp/​.X11-unix:​rw"​ --device /​dev/​nvidia0:/​dev/​nvidia0 --device /​dev/​nvidiactl:/​dev/​nvidiactl --device /​dev/​nvidia-uvm:/​dev/​nvidia-uvm ubuntu:​16.04 /bin/bash
 +</​code>​
 +
 +===== External Links =====
 +[[http://​stackoverflow.com/​questions/​25185405/​using-gpu-from-a-docker-container]]
  • public/docker_quick_how-to.txt
  • Last modified: 2018/03/31 00:38
  • (external edit)