본문 바로가기
협업툴,가상환경 정리/wsl2_명렁어-docker_GUI_with_x11

1_docker_GUI_in_linux

by 알 수 없는 사용자 2022. 12. 13.

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 호스트에 대한 그래픽 요청을 금지

 

댓글