Docker for GUI-based environments?

后端 未结 8 799
耶瑟儿~
耶瑟儿~ 2020-11-27 12:45

Problem

I have a set of client machines that are a part of an enterprise web application. Each machine runs identical software, which is a PyQT-base

8条回答
  •  情深已故
    2020-11-27 12:46

    Here are the basic steps you need to follow get things working fine,

    1. To create and run the Docker container

      sudo nvidia-docker run -it -d --privileged -e DISPLAY=$DISPLAY --name wakemeeup -v -v /dev:/dev -v /tmp/.X11-unix:/tmp/.X11-unix:rw nvidia/cuda:9.1-cudnn7-devel-ubuntu16.04 bash

    2. To start the docker container

      sudo docker start wakemeup

    3. To attach to the docker container

      xhost +local:root 1>/dev/null 2>&1 docker exec -u $USER -it wakemeup /bin/bash xhost -local:root 1>/dev/null 2>&1

    4. The MIT-SHM is an extension to the X server which allows faster transactions by using shared memory. Docker isolation probably blocks it. Qt applications can be forced not to use the extension. Inside the docker container,

      nano ~/.bashrc export QT_X11_NO_MITSHM=1

    5. Source .bashrc

      source ~/.bashrc

    Hope this will help

提交回复
热议问题