Docker Community Forums

Share and learn in the Docker community.

How to run GUI docker without bash terminal

(Binhualiu1983) #1

I deployed a java GUI program on docker, and start it in a .sh script:

docker run -it --rm -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix [image_name]

My question is: after the GUI startup, the bash terminal is still showing. Is there any way to exit the terminal after GUI show?

(0xff) #2

You can detach from it with ^P^Q (Ctrl+P, Ctrl+Q) or start it in the background in the first place, using the -d option:

docker run -d -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix [image_name]

(Binhualiu1983) #3

It works Thanks very much :slight_smile: