https://www.howtogeek.com/devops/how-to-run-gui-applications-in-a-docker-container/
How to Run GUI Applications in a Docker Container
Docker’s normally used to containerise background applications and CLI programs. You can also use it to run graphical programs though! You can either use an existing X Server, where the host machine is already running a graphical environment, or you can
www.howtogeek.com
결론 부터 말하자면
1.
$ xhost +
2. 실험 컨테이너 실행
$ sudo docker run --name linux_gui -it -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=$DISPLAY hello-world bash
gedit 깔고 실행 해보면 됨. gui 아무거나
$ xhost +
X 서버가 모든 호스트에 대해 그래픽 요청을 허용 -> 호스트 접근 제어를 하지 않겠다(disable)는 의미
$ xhost -
모든 호스트의 접근을 차단 // 호스트 접근제어를 동작(enable)하겠다 라는 의미
$ xhost + 192.168.100.100
192.168.100.100 호스트에 대한 그래픽 요청을 허용
$ xhost - 192.168.100.100
192.168.100.100 호스트에 대한 그래픽 요청을 금지
'협업툴,가상환경 정리 > wsl2_명렁어-docker_GUI_with_x11' 카테고리의 다른 글
wsl 명령어 정리 (0) | 2022.10.12 |
---|---|
3_docker_GUI_in_ssh (0) | 2022.07.12 |
2_docker_GUI_in_wsl2(window docker) (0) | 2022.07.11 |
x11 원리 개념 정리(display server, x server, x client) (0) | 2022.07.11 |
댓글