Graphical Docker Containers

Docker (a light-weight virtualization system based on container technology) is all the rage these days. Administrators, developers, and users alike are taking advantage of this technology. Many web sites may even be running on a container.

Docker allows for text based server applications to be placed in a sandbox. The reason for this is when a developer creates their application, they have specific software version requirements. The IT administrator on the other hand wishes to have the latest security patches applied to the system the application is running on. This is where containerization (and previously virtual machines) came into play. IT would have the host machine patched with the latest and greatest, while the application sat on whatever version was necessary. This is overly simplified, but it is generally the case.

Now what happens if you want to be running applications that need a graphical interface in a walled garden? A simple example is running a web browser. Many viruses spread throughout the web and come through your browser. What if you could keep your browsing in a virtual machine and reset it when it becomes infected somehow?

Perhaps you want to run that fancy application, but it comes from a not-so-trustworthy source (read: creepy install shell scripts). Wish you could launch a burner environment to test it out in?

This is where the Graphical Docker comes into play. Using a VNC server+client inside a container, we can expose a display via a browser. You start the container, expose the VNC web client’s port, and then navigate to that port via your browser. The container can even run as a non-root user to further limit the possibility of nefarious scripts or programs infecting your host machine.

Running the container is as simple as:

docker run --shm-size=256m -it -p 5901:5901 bandi13/gui-docker

This will open up a local port 5901 which you can navigate to using any browser. Head over to the Docker Hub page or the Github repo to see the latest as well as other options and start using this container for your projects today!

Liked it? Take a second to support me on Patreon!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.