xhost settings, ubuntu: 20.04 docker container start
xhost local:
docker run -it -e DISPLAY="$DISPLAY" -v /tmp/.X11-unix:/tmp/.X11-unix ubuntu:20.04
Install and run xeyes
apt-get update -y; apt-get install -y x11-apps;
I was able to output xeyes to the host side
Example 1 Change to nvidia container
xhost local:
docker run -it -e DISPLAY="$DISPLAY" -v /tmp/.X11-unix:/tmp/.X11-unix nvidia/cuda:10.1-cudnn7-devel-ubuntu18.04
Example 2 Example 1 + option added
xhost local:
docker run -it -e DISPLAY="$DISPLAY" -v /tmp/.X11-unix:/tmp/.X11-unix --gpus 1 nvidia/cuda:10.1-cudnn7-devel-ubuntu18.04
The following is the procedure for using the nvidia container
Reference Notes on installing OpenCV4.1.1 with Docker (Ubuntu18.04 + CUDA10.1 + cudnn7) Installation (Native GPU Support)
sudo apt install curl
curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add -
distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list
sudo apt update
sudo apt-get install -y nvidia-container-toolkit
The following is a reference when running and executing internal commands (execute nvidia-smi)
docker run --gpus 1 nvidia/cuda:10.1-cudnn7-devel-ubuntu18.04 nvidia-smi
[Launch GUI application in Docker container](https://unskilled.site/docker%E3%82%B3%E3%83%B3%E3%83%86%E3%83%8A%E3%81 % AE% E4% B8% AD% E3% 81% A7gui% E3% 82% A2% E3% 83% 97% E3% 83% AA% E3% 82% B1% E3% 83% BC% E3% 82% B7 % E3% 83% A7% E3% 83% B3% E3% 82% 92% E8% B5% B7% E5% 8B% 95% E3% 81% 95% E3% 81% 9B% E3% 82% 8B / How to display GUI on Ubuntu on Docker on Ubuntu
Launch GUI on Docker container host Install Docker to create a GUI-operable Linux (Ubuntu) container Building an environment where GUI applications can be started with docker [Client <-> Remote server <-> docker container] Try building a desktop environment (GUI) with docker. Launch GUI on Docker container host
Recommended Posts