I wrote some Java desktop applications and thought I'd run them with Docker to learn about containers.
I got the Java applications into a Docker container with an ubuntu image. And that's when I realized that I needed to give Docker the ability to access my DISPLAY variable in order for the GUI to work / get access to my computer's I/O. Once I got that connected, I could run the docker container and see the GUI pop up on my computer screen.
Here's where I start getting confused. If I run a desktop GUI in say, VirtualBox, I can see the gui in the virtual machine; it's on the virtual computer. And then there is something smart that connects the vm I/O to my local machine's I/O. That makes sense to me.
But how is Docker getting the GUI back onto my actual computer? When I run the container, I can see the GUI on my actual computer (not in a vm like virtualbox). But how does the GUI itself render on the host machine? When I share the I/O with my host machine, does that give Docker the permission to send the GUI files back to the host machine to display the GUI? Or did I basically create a virtual machine when I created the container with the ubuntu image?